Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: Move s390 sysctls into their own file under arch/s390

Move s390 sysctls (spin_retry and userprocess_debug) into their own
files under arch/s390. Create two new sysctl tables
(2390_{fault,spin}_sysctl_table) which will be initialized with
arch_initcall placing them after their original place in proc_root_init.

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.

Signed-off-by: joel granados <joel.granados@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250306-jag-mv_ctltables-v2-6-71b243c8d3f8@kernel.org
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

joel granados and committed by
Vasily Gorbik
20de8f8d 5983ab16

+35 -18
+18
arch/s390/lib/spinlock.c
··· 10 10 #include <linux/export.h> 11 11 #include <linux/spinlock.h> 12 12 #include <linux/jiffies.h> 13 + #include <linux/sysctl.h> 13 14 #include <linux/init.h> 14 15 #include <linux/smp.h> 15 16 #include <linux/percpu.h> ··· 38 37 return 1; 39 38 } 40 39 __setup("spin_retry=", spin_retry_setup); 40 + 41 + static const struct ctl_table s390_spin_sysctl_table[] = { 42 + { 43 + .procname = "spin_retry", 44 + .data = &spin_retry, 45 + .maxlen = sizeof(int), 46 + .mode = 0644, 47 + .proc_handler = proc_dointvec, 48 + }, 49 + }; 50 + 51 + static int __init init_s390_spin_sysctls(void) 52 + { 53 + register_sysctl_init("kernel", s390_spin_sysctl_table); 54 + return 0; 55 + } 56 + arch_initcall(init_s390_spin_sysctls); 41 57 42 58 struct spin_wait { 43 59 struct spin_wait *next, *prev;
+17
arch/s390/mm/fault.c
··· 165 165 166 166 int show_unhandled_signals = 1; 167 167 168 + static const struct ctl_table s390_fault_sysctl_table[] = { 169 + { 170 + .procname = "userprocess_debug", 171 + .data = &show_unhandled_signals, 172 + .maxlen = sizeof(int), 173 + .mode = 0644, 174 + .proc_handler = proc_dointvec, 175 + }, 176 + }; 177 + 178 + static int __init init_s390_fault_sysctls(void) 179 + { 180 + register_sysctl_init("kernel", s390_fault_sysctl_table); 181 + return 0; 182 + } 183 + arch_initcall(init_s390_fault_sysctls); 184 + 168 185 void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault) 169 186 { 170 187 static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);
-18
kernel/sysctl.c
··· 1794 1794 .extra1 = SYSCTL_ZERO, 1795 1795 .extra2 = SYSCTL_MAXOLDUID, 1796 1796 }, 1797 - #ifdef CONFIG_S390 1798 - { 1799 - .procname = "userprocess_debug", 1800 - .data = &show_unhandled_signals, 1801 - .maxlen = sizeof(int), 1802 - .mode = 0644, 1803 - .proc_handler = proc_dointvec, 1804 - }, 1805 - #endif 1806 1797 { 1807 1798 .procname = "panic_on_oops", 1808 1799 .data = &panic_on_oops, ··· 1884 1893 .procname = "randomize_va_space", 1885 1894 .data = &randomize_va_space, 1886 1895 .maxlen = sizeof(int), 1887 - .mode = 0644, 1888 - .proc_handler = proc_dointvec, 1889 - }, 1890 - #endif 1891 - #if defined(CONFIG_S390) && defined(CONFIG_SMP) 1892 - { 1893 - .procname = "spin_retry", 1894 - .data = &spin_retry, 1895 - .maxlen = sizeof (int), 1896 1896 .mode = 0644, 1897 1897 .proc_handler = proc_dointvec, 1898 1898 },