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)
Wed, Oct 29, 12:03 AM
Unknown Object (File)
Sun, Oct 26, 9:09 PM
Unknown Object (File)
Sun, Oct 26, 6:17 PM
Unknown Object (File)
Sun, Oct 26, 6:17 PM
Unknown Object (File)
Sun, Oct 26, 12:27 PM
Unknown Object (File)
Sun, Oct 26, 12:27 PM
Unknown Object (File)
Sun, Oct 26, 12:26 PM
Unknown Object (File)
Sun, Oct 26, 5:59 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33327
Build 30638: arc lint + arc unit

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

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.