HomeFreeBSD

socket: Reorder socket and sockbuf fields to eliminate some padding

Description

socket: Reorder socket and sockbuf fields to eliminate some padding

This is in preparation for moving sockbuf locks into the owning socket,
in order to provide proper interlocking for listen(2). In particular,
listening sockets do not use the socket buffers and repurpose that space
in struct socket for their own purposes. Moving the locks out of the
socket buffers and into the socket proper makes it possible to safely
lock socket buffers and test for a listening socket before deciding how
to proceed.

Reordering these fields saves some space and helps ensure that UMA will
provide the same space efficiency for sockets as before. No functional
change intended.

Reviewed by: tuexen, gallatin
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31656

Details

Provenance
markjAuthored on Sep 7 2021, 6:45 PM
Reviewer
tuexen
Differential Revision
D31656: socket: Reorder socket and sockbuf fields to eliminate some padding
Parents
rG686aa9287c6b: swap_pager: Handle large swap_pager_reserve() requests
Branches
Unknown
Tags
Unknown