Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2018 05:17:16 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341182 - in head/sys: kern sys
Message-ID:  <201811290517.wAT5HGYq078664@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Nov 29 05:17:16 2018
New Revision: 341182
URL: https://svnweb.freebsd.org/changeset/base/341182

Log:
  Convert racct_enable to bool and annotate as __read_frequently
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c
  head/sys/sys/racct.h

Modified: head/sys/kern/kern_racct.c
==============================================================================
--- head/sys/kern/kern_racct.c	Thu Nov 29 05:08:46 2018	(r341181)
+++ head/sys/kern/kern_racct.c	Thu Nov 29 05:17:16 2018	(r341182)
@@ -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.");

Modified: head/sys/sys/racct.h
==============================================================================
--- head/sys/sys/racct.h	Thu Nov 29 05:08:46 2018	(r341181)
+++ head/sys/sys/racct.h	Thu Nov 29 05:17:16 2018	(r341182)
@@ -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__))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811290517.wAT5HGYq078664>