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)
Jun 28 2025, 9:57 PM
Unknown Object (File)
Jun 17 2025, 9:29 PM
Unknown Object (File)
Jun 17 2025, 3:31 AM
Unknown Object (File)
Jun 2 2025, 1:32 AM
Unknown Object (File)
Jun 1 2025, 6:40 AM
Unknown Object (File)
May 31 2025, 3:59 PM
Unknown Object (File)
May 31 2025, 9:34 AM
Unknown Object (File)
May 30 2025, 9:07 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.