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

Configure Feed

Select the types of activity you want to include in your feed.

locking/rtmutex: Move max_lock_depth into rtmutex.c

Move the max_lock_depth sysctl table element into rtmutex_api.c. Removed
the rtmutex.h include from sysctl.c. Chose to move into rtmutex_api.c
to avoid multiple registrations every time rtmutex.c is included in other
files.

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>

+19 -13
+1 -1
include/linux/rtmutex.h
··· 18 18 #include <linux/rbtree_types.h> 19 19 #include <linux/spinlock_types_raw.h> 20 20 21 - extern int max_lock_depth; /* for sysctl */ 21 + extern int max_lock_depth; 22 22 23 23 struct rt_mutex_base { 24 24 raw_spinlock_t wait_lock;
+18
kernel/locking/rtmutex_api.c
··· 13 13 */ 14 14 int max_lock_depth = 1024; 15 15 16 + static const struct ctl_table rtmutex_sysctl_table[] = { 17 + { 18 + .procname = "max_lock_depth", 19 + .data = &max_lock_depth, 20 + .maxlen = sizeof(int), 21 + .mode = 0644, 22 + .proc_handler = proc_dointvec, 23 + }, 24 + }; 25 + 26 + static int __init init_rtmutex_sysctl(void) 27 + { 28 + register_sysctl_init("kernel", rtmutex_sysctl_table); 29 + return 0; 30 + } 31 + 32 + subsys_initcall(init_rtmutex_sysctl); 33 + 16 34 /* 17 35 * Debug aware fast / slowpath lock,trylock,unlock 18 36 *
-12
kernel/sysctl.c
··· 59 59 #include <asm/nmi.h> 60 60 #include <asm/io.h> 61 61 #endif 62 - #ifdef CONFIG_RT_MUTEXES 63 - #include <linux/rtmutex.h> 64 - #endif 65 62 66 63 /* shared constants to be used in various sysctls */ 67 64 const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; ··· 1702 1705 .procname = "ignore-unaligned-usertrap", 1703 1706 .data = &no_unaligned_warning, 1704 1707 .maxlen = sizeof (int), 1705 - .mode = 0644, 1706 - .proc_handler = proc_dointvec, 1707 - }, 1708 - #endif 1709 - #ifdef CONFIG_RT_MUTEXES 1710 - { 1711 - .procname = "max_lock_depth", 1712 - .data = &max_lock_depth, 1713 - .maxlen = sizeof(int), 1714 1708 .mode = 0644, 1715 1709 .proc_handler = proc_dointvec, 1716 1710 },