Convert racct_enable to bool and annotate as __read_frequently

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
mjg 2018-11-29 05:17:16 +00:00
parent ea1fbe943e
commit 84ecf3e3b9
2 changed files with 4 additions and 4 deletions

View File

@ -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.");

View File

@ -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__))