Page MenuHomeFreeBSD

inpcb: use global UMA zones for protocols
ClosedPublic

Authored by glebius on Dec 17 2021, 7:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 2:30 AM
Unknown Object (File)
Thu, Dec 5, 6:14 PM
Unknown Object (File)
Nov 23 2024, 4:48 PM
Unknown Object (File)
Nov 15 2024, 7:51 PM
Unknown Object (File)
Sep 28 2024, 10:06 AM
Unknown Object (File)
Sep 27 2024, 7:18 PM
Unknown Object (File)
Sep 27 2024, 1:18 PM
Unknown Object (File)
Sep 24 2024, 4:06 PM
Subscribers

Details

Summary

Provide structure inpcbstorage, that holds zones and lock names for
a protocol. Initialize it with global protocol init using macro
INPCBSTORAGE_DEFINE(). Then, at VNET protocol init supply it as
the main argument to the in_pcbinfo_init(). Each VNET pcbinfo uses
its private hash, but they all use same zone to allocate and SMR
section to synchronize.

Diff Detail

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

Event Timeline

This change leaves one thing that needs to be discussed. We have this kern.ipc.maxsockets sysctl, which controls UMA limit on the socket zone, which was always global. It is typical user resource management control. Historically same maxsockets value is applied also to every PCB zone. Important fact: you can't create a pcb without a socket! A pcb may outlive its socket, however. Given that there are multiple protocols, and only one socket zone, the per pcb zone limits seems to have little value. Under very special conditions it may trigger a little bit earlier than socket zone limit, but in most setups the socket zone limit will be triggered earlier. When VIMAGE was added to the kernel PCB zones became per-VNET. This magnified existing dis balance further: now we have multiple pcb zones in multiple vnets limited to maxsockets, but every pcb requires a socket allocated from the global zone also limited by maxsockets. IMHO, this per pcb zone limit doesn't bring any value, so this patch drops it.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 3 2022, 6:23 PM
This revision was automatically updated to reflect the committed changes.