Page MenuHomeFreeBSD

inpcb: Remove a PCB from its LB group upon a subsequent error
ClosedPublic

Authored by markj on Oct 17 2022, 8:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 10:13 AM
Unknown Object (File)
Sat, May 25, 10:13 AM
Unknown Object (File)
Sat, May 25, 10:13 AM
Unknown Object (File)
Sat, May 25, 9:59 AM
Unknown Object (File)
Jan 31 2024, 12:54 PM
Unknown Object (File)
Jan 22 2024, 7:51 PM
Unknown Object (File)
Dec 23 2023, 12:41 AM
Unknown Object (File)
Nov 20 2023, 7:25 AM

Details

Summary

If a memory allocation failure causes bind to fail, we should take the
inpcb back out of its LB group since it's not prepared to handle
connections.

Diff Detail

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

Event Timeline

markj requested review of this revision.Oct 17 2022, 8:39 PM

In the context of bind(2) we definitely can M_WAITOK. At what conditions is M_NOWAIT required?

This revision is now accepted and ready to land.Oct 18 2022, 4:31 AM

In the context of bind(2) we definitely can M_WAITOK. At what conditions is M_NOWAIT required?

The inpcb mutex forces us to use M_NOWAIT here. Maybe those structures should be embedded in the port hash table instead. Though, right now we consume ~3MB per VNET jail for M_PCB mallocs.