aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2018-11-29 05:17:16 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2018-11-29 05:17:16 +0000
commiteec8d0a378b1d09394d7306a59d71e0503f517bd (patch)
tree635a51840bb745a2db5df2a267363f8d96f70d00
parent64cf6a62d419ba4df40ebb12c0dd9130128e0724 (diff)
downloadsrc-eec8d0a378b1d09394d7306a59d71e0503f517bd.tar.gz
src-eec8d0a378b1d09394d7306a59d71e0503f517bd.zip
Convert racct_enable to bool and annotate as __read_frequently
Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=341182
-rw-r--r--sys/kern/kern_racct.c6
-rw-r--r--sys/sys/racct.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index 4b7b0bfba0b7..f6d2add90a51 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -74,13 +74,13 @@ FEATURE(racct, "Resource Accounting");
*/
static int pcpu_threshold = 1;
#ifdef RACCT_DEFAULT_TO_DISABLED
-int racct_enable = 0;
+bool __read_frequently racct_enable = false;
#else
-int racct_enable = 1;
+bool __read_frequently racct_enable = true;
#endif
SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW, 0, "Resource Accounting");
-SYSCTL_UINT(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable,
+SYSCTL_BOOL(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable,
0, "Enable RACCT/RCTL");
SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, &pcpu_threshold,
0, "Processes with higher %cpu usage than this value can be throttled.");
diff --git a/sys/sys/racct.h b/sys/sys/racct.h
index 73ec04a0a0cd..57291e1d45ba 100644
--- a/sys/sys/racct.h
+++ b/sys/sys/racct.h
@@ -91,7 +91,7 @@ struct ucred;
#define RACCT_DECAYING 0x20
extern int racct_types[];
-extern int racct_enable;
+extern bool racct_enable;
#define ASSERT_RACCT_ENABLED() KASSERT(racct_enable, \
("%s called with !racct_enable", __func__))