Page MenuHomeFreeBSD

[unix(4) cleanup 2/8] Improve unix socket refcounting.
ClosedPublic

Authored by markj on Sep 2 2020, 4:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 12:44 PM
Unknown Object (File)
Jan 29 2024, 2:10 PM
Unknown Object (File)
Jan 13 2024, 11:30 AM
Unknown Object (File)
Dec 22 2023, 10:36 PM
Unknown Object (File)
Nov 1 2023, 11:21 AM
Unknown Object (File)
Sep 3 2023, 6:46 AM
Unknown Object (File)
Sep 3 2023, 6:45 AM
Unknown Object (File)
Sep 3 2023, 6:44 AM

Details

Summary


- Use refcount_init().
- Define an INVARIANTS-only zone destructor to assert that various
bits of PCB state aren't dangling.
- Annotate unp_pcb_rele() with __result_use_check.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Sep 2 2020, 4:55 PM
markj created this revision.
This revision is now accepted and ready to land.Sep 3 2020, 4:46 AM
kevans added a subscriber: kevans.

We have some other callers doing unp_pcb_rele(...) == 0 that we should probably eventually clean up to match, but I don't suppose that needs to be done here.

We have some other callers doing unp_pcb_rele(...) == 0 that we should probably eventually clean up to match, but I don't suppose that needs to be done here.

After the full patchset is applied those are all gone, i.e., we use consistent style.

We have some other callers doing unp_pcb_rele(...) == 0 that we should probably eventually clean up to match, but I don't suppose that needs to be done here.

After the full patchset is applied those are all gone, i.e., we use consistent style.

Yeah, my bad. Just started a good, hard look at D26297 and discovered it to take care of most (or all?) of them.

kib added a subscriber: kib.
kib added inline comments.
sys/kern/uipc_usrreq.c
319 ↗(On Diff #76541)

I wonder if this function should be moved to refcount.h, I think we already have more than two instances of such code.

This revision was automatically updated to reflect the committed changes.