]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rcu: Move rcu_stall related sysctls into rcu/tree_stall.h
authorJoel Granados <joel.granados@kernel.org>
Wed, 30 Apr 2025 12:07:33 +0000 (14:07 +0200)
committerJoel Granados <joel.granados@kernel.org>
Wed, 23 Jul 2025 09:52:47 +0000 (11:52 +0200)
Move sysctl_panic_on_rcu_stall and sysctl_max_rcu_stall_to_panic into
the kernel/rcu subdirectory. Make these static in tree_stall.h and
removed them as extern from panic.h as their scope is now confined into
one file.

This is part of a greater effort to move ctl tables into their
respective subsystems which will reduce the merge conflicts in
kernel/sysctl.c.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
include/linux/panic.h
kernel/rcu/tree_stall.h
kernel/sysctl.c

index 4adc6576693549e31f85750e698ad294ec0aaaf0..8f2b5d92ac05013b5ceb44dc0f5e2fe32051eac2 100644 (file)
@@ -25,8 +25,6 @@ extern int panic_on_warn;
 extern unsigned long panic_on_taint;
 extern bool panic_on_taint_nousertaint;
 
-extern int sysctl_panic_on_rcu_stall;
-extern int sysctl_max_rcu_stall_to_panic;
 extern int sysctl_panic_on_stackoverflow;
 
 extern bool crash_kexec_post_notifiers;
index 486c00536207d58a621ee97cf2e83834cdb186aa..69482c2f0771e57117210786bbb9d1e01a5ecf39 100644 (file)
 // Controlling CPU stall warnings, including delay calculation.
 
 /* panic() on RCU Stall sysctl. */
-int sysctl_panic_on_rcu_stall __read_mostly;
-int sysctl_max_rcu_stall_to_panic __read_mostly;
+static int sysctl_panic_on_rcu_stall __read_mostly;
+static int sysctl_max_rcu_stall_to_panic __read_mostly;
+
+static const struct ctl_table rcu_stall_sysctl_table[] = {
+       {
+               .procname       = "panic_on_rcu_stall",
+               .data           = &sysctl_panic_on_rcu_stall,
+               .maxlen         = sizeof(sysctl_panic_on_rcu_stall),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = SYSCTL_ZERO,
+               .extra2         = SYSCTL_ONE,
+       },
+       {
+               .procname       = "max_rcu_stall_to_panic",
+               .data           = &sysctl_max_rcu_stall_to_panic,
+               .maxlen         = sizeof(sysctl_max_rcu_stall_to_panic),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec_minmax,
+               .extra1         = SYSCTL_ONE,
+               .extra2         = SYSCTL_INT_MAX,
+       },
+};
+
+static int __init init_rcu_stall_sysctl(void)
+{
+       register_sysctl_init("kernel", rcu_stall_sysctl_table);
+       return 0;
+}
+
+subsys_initcall(init_rcu_stall_sysctl);
 
 #ifdef CONFIG_SYSFS
 
index a22f35013da0d838ef421fc5d192f00d1e70fb0f..fd76f0e1d490940a67d72403d72d204ff13d888a 100644 (file)
@@ -1706,26 +1706,6 @@ static const struct ctl_table kern_table[] = {
                .proc_handler   = proc_dointvec,
        },
 #endif
-#ifdef CONFIG_TREE_RCU
-       {
-               .procname       = "panic_on_rcu_stall",
-               .data           = &sysctl_panic_on_rcu_stall,
-               .maxlen         = sizeof(sysctl_panic_on_rcu_stall),
-               .mode           = 0644,
-               .proc_handler   = proc_dointvec_minmax,
-               .extra1         = SYSCTL_ZERO,
-               .extra2         = SYSCTL_ONE,
-       },
-       {
-               .procname       = "max_rcu_stall_to_panic",
-               .data           = &sysctl_max_rcu_stall_to_panic,
-               .maxlen         = sizeof(sysctl_max_rcu_stall_to_panic),
-               .mode           = 0644,
-               .proc_handler   = proc_dointvec_minmax,
-               .extra1         = SYSCTL_ONE,
-               .extra2         = SYSCTL_INT_MAX,
-       },
-#endif
 };
 
 int __init sysctl_init_bases(void)