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
F157008493: D26295.diff
Sun, May 17, 10:38 PM
Unknown Object (File)
Fri, May 8, 6:02 PM
Unknown Object (File)
Wed, May 6, 12:46 AM
Unknown Object (File)
Mon, May 4, 1:17 PM
Unknown Object (File)
Thu, Apr 30, 5:14 PM
Unknown Object (File)
Tue, Apr 21, 6:29 PM
Unknown Object (File)
Apr 15 2026, 10:36 AM
Unknown Object (File)
Mar 28 2026, 2:50 PM

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.