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.
Unified · Split
| @@ -25,8 +25,6 @@ extern int panic_on_warn; · 24 unmodified lines | ||
| 25 | 25 | extern unsigned long panic_on_taint; |
| 26 | 26 | extern bool panic_on_taint_nousertaint; |
| 27 | 27 | |
| 28 | −extern int sysctl_panic_on_rcu_stall; | |
| 29 | −extern int sysctl_max_rcu_stall_to_panic; | |
| 30 | 28 | extern int sysctl_panic_on_stackoverflow; |
| 31 | 29 | |
| 32 | 30 | extern bool crash_kexec_post_notifiers; |
| @@ -17,8 +17,37 @@ · 16 unmodified lines | ||
| 17 | 17 | // Controlling CPU stall warnings, including delay calculation. |
| 18 | 18 | |
| 19 | 19 | /* panic() on RCU Stall sysctl. */ |
| 20 | −int sysctl_panic_on_rcu_stall __read_mostly; | |
| 21 | −int sysctl_max_rcu_stall_to_panic __read_mostly; | |
| 20 | +static int sysctl_panic_on_rcu_stall __read_mostly; | |
| 21 | +static int sysctl_max_rcu_stall_to_panic __read_mostly; | |
| 22 | + | |
| 23 | +static const struct ctl_table rcu_stall_sysctl_table[] = { | |
| 24 | + { | |
| 25 | + .procname = "panic_on_rcu_stall", | |
| 26 | + .data = &sysctl_panic_on_rcu_stall, | |
| 27 | + .maxlen = sizeof(sysctl_panic_on_rcu_stall), | |
| 28 | + .mode = 0644, | |
| 29 | + .proc_handler = proc_dointvec_minmax, | |
| 30 | + .extra1 = SYSCTL_ZERO, | |
| 31 | + .extra2 = SYSCTL_ONE, | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + .procname = "max_rcu_stall_to_panic", | |
| 35 | + .data = &sysctl_max_rcu_stall_to_panic, | |
| 36 | + .maxlen = sizeof(sysctl_max_rcu_stall_to_panic), | |
| 37 | + .mode = 0644, | |
| 38 | + .proc_handler = proc_dointvec_minmax, | |
| 39 | + .extra1 = SYSCTL_ONE, | |
| 40 | + .extra2 = SYSCTL_INT_MAX, | |
| 41 | + }, | |
| 42 | +}; | |
| 43 | + | |
| 44 | +static int __init init_rcu_stall_sysctl(void) | |
| 45 | +{ | |
| 46 | + register_sysctl_init("kernel", rcu_stall_sysctl_table); | |
| 47 | + return 0; | |
| 48 | +} | |
| 49 | + | |
| 50 | +subsys_initcall(init_rcu_stall_sysctl); | |
| 22 | 51 | |
| 23 | 52 | #ifdef CONFIG_SYSFS |
| 24 | 53 | |
| @@ -1706,26 +1706,6 @@ static const struct ctl_table kern_table[] = { · 1705 unmodified lines | ||
| 1706 | 1706 | .proc_handler = proc_dointvec, |
| 1707 | 1707 | }, |
| 1708 | 1708 | #endif |
| 1709 | −#ifdef CONFIG_TREE_RCU | |
| 1710 | − { | |
| 1711 | − .procname = "panic_on_rcu_stall", | |
| 1712 | − .data = &sysctl_panic_on_rcu_stall, | |
| 1713 | − .maxlen = sizeof(sysctl_panic_on_rcu_stall), | |
| 1714 | − .mode = 0644, | |
| 1715 | − .proc_handler = proc_dointvec_minmax, | |
| 1716 | − .extra1 = SYSCTL_ZERO, | |
| 1717 | − .extra2 = SYSCTL_ONE, | |
| 1718 | − }, | |
| 1719 | − { | |
| 1720 | − .procname = "max_rcu_stall_to_panic", | |
| 1721 | − .data = &sysctl_max_rcu_stall_to_panic, | |
| 1722 | − .maxlen = sizeof(sysctl_max_rcu_stall_to_panic), | |
| 1723 | − .mode = 0644, | |
| 1724 | − .proc_handler = proc_dointvec_minmax, | |
| 1725 | − .extra1 = SYSCTL_ONE, | |
| 1726 | − .extra2 = SYSCTL_INT_MAX, | |
| 1727 | − }, | |
| 1728 | −#endif | |
| 1729 | 1709 | }; |
| 1730 | 1710 | |
| 1731 | 1711 | int __init sysctl_init_bases(void) |