From: Alexander Bluhm Subject: Re: unlock tcp drop sysctl To: Vitaliy Makkoveev Cc: tech@openbsd.org Date: Thu, 9 Jan 2025 19:59:25 +0100 On Thu, Jan 09, 2025 at 07:00:42PM +0300, Vitaliy Makkoveev wrote: > Would you like to split tcp_sysctl() with tcp_sysctl_locked() and > start slightly moving some paths out of sysctl lock? If I understand correctly, PR_MPSYSCTL prevents kernel lock, does not serialize sysctl calls, and does not wire the memory for copyin(). TCP sysctl does not care about kernel lock. It uses either atomic integers, mutex protection or exclusive net lock. Calling copyin() or copyout() without wired memory while holding the net lock is bad due to NFS. I think is easier to remove net lock sysctl per sysctl and then switch the whole tcp_sysctl() instead of introducing tcp_sysctl_locked(). bluhm