swrap: fix copy on write leak of ~38M for every fork.
authorStefan Metzmacher <metze@samba.org>
Thu, 4 Feb 2021 04:02:32 +0000 (05:02 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 5 Feb 2021 13:11:31 +0000 (14:11 +0100)
commit13a6aca342120383776251247c72170c142bf017
tree57321d4d74b05eac06db4f3363e2c23e908e9958
parent92a4fce9df55e4c1a3b75325baa0f4b0988eeb6c
swrap: fix copy on write leak of ~38M for every fork.

commit 0f8e90dd7e59c473be615dee08d445dca98fdab9
(src/socket_wrapper.c: fix mutex fork handling)
let us touch the whole sockets array on every fork,
because each element in the array has it's own mutex.

max_sockets=65535 * sizeof(struct socket_info_container)=592 = 38796720

This was designed for the use of robust shared mutexes
when moving the sockets array into a shared memory file.

Until we really move to shared memory, we can use a single
global mutex in order to avoid the copy on write leaking.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c