Annontate FreeBSD sysctls with CTLFLAG_MPSAFE
commit6bdb09510bd27038ee85c372035b27120a4f46c6
authorMark Johnston <markjdb@gmail.com>
Fri, 18 Sep 2020 12:45:54 +0000 (18 08:45 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 21 Sep 2020 16:49:50 +0000 (21 09:49 -0700)
treea764d927190bee60cceb21537d7f6ac9503d9b86
parentc50f3c902fa565379e005fa9d0431f17f65f2a04
Annontate FreeBSD sysctls with CTLFLAG_MPSAFE

Without this, the sysctl system calls will acquire a global lock before
invoking the handler.  This is noticeable in some situations when
running top(1).  The global lock is mostly vestigal but continues to see
some use and so contention is still a problem; until the default sense
of the MPSAFE flag changes, we have to annotate each and every handler.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #10836
module/os/freebsd/spl/spl_kstat.c
module/os/freebsd/zfs/sysctl_os.c