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)
Jan 18 2024, 9:41 AM
Unknown Object (File)
Dec 20 2023, 6:32 AM
Unknown Object (File)
Sep 14 2023, 8:56 PM
Unknown Object (File)
Sep 12 2023, 10:37 PM
Unknown Object (File)
Sep 1 2023, 10:59 AM
Unknown Object (File)
Aug 26 2023, 11:50 PM
Unknown Object (File)
Jul 26 2023, 10:22 AM
Unknown Object (File)
Jul 11 2023, 9:52 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.