diff options
author | Pawel Biernacki <kaktus@FreeBSD.org> | 2020-02-26 14:26:36 +0000 |
---|---|---|
committer | Pawel Biernacki <kaktus@FreeBSD.org> | 2020-02-26 14:26:36 +0000 |
commit | 7029da5c36f2d3cf6bb6c81bf551229f416399e8 (patch) | |
tree | 53cae9da1371117a3ac21d0d0f3f030a692807ae /sys/kern/kern_ktr.c | |
parent | d7313dc6f5fcab29946951936597772dfff6a4be (diff) | |
download | src-7029da5c36f2d3cf6bb6c81bf551229f416399e8.tar.gz src-7029da5c36f2d3cf6bb6c81bf551229f416399e8.zip |
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.
Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT
Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718
Notes
Notes:
svn path=/head/; revision=358333
Diffstat (limited to 'sys/kern/kern_ktr.c')
-rw-r--r-- | sys/kern/kern_ktr.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index 4d3229cceaeb..48b736c1b2c3 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -102,7 +102,8 @@ struct ktr_entry ktr_buf_init[KTR_BOOT_ENTRIES]; struct ktr_entry *ktr_buf = ktr_buf_init; cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); -static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options"); +static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "KTR options"); SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0, "Version of the KTR interface"); @@ -150,8 +151,10 @@ sysctl_debug_ktr_clear(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW, 0, 0, - sysctl_debug_ktr_clear, "I", "Clear KTR Buffer"); +SYSCTL_PROC(_debug_ktr, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_debug_ktr_clear, "I", + "Clear KTR Buffer"); /* * This is a sysctl proc so that it is serialized as !MPSAFE along with @@ -171,8 +174,9 @@ sysctl_debug_ktr_mask(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_U64 | CTLFLAG_RWTUN, 0, 0, - sysctl_debug_ktr_mask, "QU", +SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, + CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_debug_ktr_mask, "QU", "Bitmask of KTR event classes for which logging is enabled"); #if KTR_ENTRIES > KTR_BOOT_ENTRIES @@ -242,8 +246,10 @@ sysctl_debug_ktr_entries(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, entries, CTLTYPE_INT|CTLFLAG_RW, 0, 0, - sysctl_debug_ktr_entries, "I", "Number of entries in the KTR buffer"); +SYSCTL_PROC(_debug_ktr, OID_AUTO, entries, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_debug_ktr_entries, "I", + "Number of entries in the KTR buffer"); #ifdef KTR_VERBOSE int ktr_verbose = KTR_VERBOSE; @@ -305,8 +311,9 @@ sysctl_debug_ktr_alq_enable(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_debug_ktr, OID_AUTO, alq_enable, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_debug_ktr_alq_enable, - "I", "Enable KTR logging"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_debug_ktr_alq_enable, "I", + "Enable KTR logging"); #endif void |