git: 82e3f2709ce2 - stable/12 - cam_iosched: use tunable flag and make a bool really a bool

Warner Losh imp at FreeBSD.org
Wed Jul 21 16:18:51 UTC 2021


The branch stable/12 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=82e3f2709ce2c38c4ed6d386c97550eb700af6e7

commit 82e3f2709ce2c38c4ed6d386c97550eb700af6e7
Author:     Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-07-13 06:00:33 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-07-21 16:16:31 +0000

    cam_iosched: use tunable flag and make a bool really a bool
    
    kern.cam.do_dynamic_iosched is really a bool, so change its type to
    bool. While I'm here, also use the CTLFLAG_TUN flag instead of a
    separate tunable line for it and kern.cam.iosched_alpha_bits.
    
    MFC After:              1 week
    Sponsored by:           Netflix
    
    (cherry picked from commit a065ccb2804fae834a7c66e29b726ea3dbbceace)
---
 sys/cam/cam_iosched.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c
index 6e1f6d52d0eb..0b4d89468804 100644
--- a/sys/cam/cam_iosched.c
+++ b/sys/cam/cam_iosched.c
@@ -70,9 +70,8 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/O Scheduler",
 
 #ifdef CAM_IOSCHED_DYNAMIC
 
-static int do_dynamic_iosched = 1;
-TUNABLE_INT("kern.cam.do_dynamic_iosched", &do_dynamic_iosched);
-SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD,
+static bool do_dynamic_iosched = 1;
+SYSCTL_BOOL(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD | CTLFLAG_TUN,
     &do_dynamic_iosched, 1,
     "Enable Dynamic I/O scheduler optimizations.");
 
@@ -97,8 +96,7 @@ SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD,
  * Note: See computation of EMA and EMVAR for acceptable ranges of alpha.
  */
 static int alpha_bits = 9;
-TUNABLE_INT("kern.cam.iosched_alpha_bits", &alpha_bits);
-SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW | CTLFLAG_TUN,
     &alpha_bits, 1,
     "Bits in EMA's alpha.");
 


More information about the dev-commits-src-all mailing list