Page MenuHomeFreeBSD

in_pcb: delay crfree() down into UMA dtor
ClosedPublic

Authored by glebius on Dec 5 2021, 4:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 8, 7:56 PM
Unknown Object (File)
Mon, May 4, 5:57 PM
Unknown Object (File)
Sun, May 3, 7:22 AM
Unknown Object (File)
Sun, May 3, 6:32 AM
Unknown Object (File)
Wed, Apr 29, 1:27 PM
Unknown Object (File)
Tue, Apr 28, 1:04 AM
Unknown Object (File)
Sun, Apr 26, 12:53 PM
Unknown Object (File)
Sun, Apr 19, 9:22 PM
Subscribers

Details

Summary

inpcb lookups, which check inp_cred, work with pcbs that potentially went
through in_pcbfree(). So inp_cred should stay valid until SMR guarantees
its invisibility to lookups.

Submitted by: markj

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems ok, just a couple of minor optional notes.

We should really use SMR_POINTER and the other smr_types.h machinery to wrap inp_cred. This would require some churn though, since inp_cred is referenced directly in many places.

sys/netinet/in_pcb.c
1863

Perhaps set inp->inp_cred = NULL at least if INVARIANTS is defined.

1879

IMHO it is more logical to group UMA zone methods together, i.e., I would group this with inpcb_fini().

This revision is now accepted and ready to land.Dec 5 2021, 6:33 PM
sys/netinet/in_pcb.c
1863

I can do it.

1879

Do you agree if I move inpcb_fini() down to here, rather than move inpcb_dtor() up? I'd like to put the whole destruction sequence sequential and readable from top to bottom?

sys/netinet/in_pcb.c
1879

Fine with me.

This revision was automatically updated to reflect the committed changes.