kernel/lockdep: move lockdep sysctls to its own file
conflict in kernel/sysctl.c detail: some conditional includes remain in the context due to the commits removing them not being backported to c9s action: remove relevant section and maintain context commit f79c9b8ae8bde10126586c1bb55b5fd027276d8e Author: tangmeng <tangmeng@uniontech.com> Date: Fri Feb 18 18:58:57 2022 +0800 kernel/lockdep: move lockdep sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the prove_locking and lock_stat sysctls to its own file, kernel/lockdep.c. Signed-off-by: tangmeng <tangmeng@uniontech.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2176147 Signed-off-by: Joel Savitz <jsavitz@redhat.com>
This commit is contained in:
parent
39d5485852
commit
1ac1f27d39
|
@ -16,10 +16,6 @@
|
|||
|
||||
struct task_struct;
|
||||
|
||||
/* for sysctl */
|
||||
extern int prove_locking;
|
||||
extern int lock_stat;
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
|
|
@ -63,19 +63,50 @@
|
|||
#include <trace/events/lock.h>
|
||||
|
||||
#ifdef CONFIG_PROVE_LOCKING
|
||||
int prove_locking = 1;
|
||||
static int prove_locking = 1;
|
||||
module_param(prove_locking, int, 0644);
|
||||
#else
|
||||
#define prove_locking 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOCK_STAT
|
||||
int lock_stat = 1;
|
||||
static int lock_stat = 1;
|
||||
module_param(lock_stat, int, 0644);
|
||||
#else
|
||||
#define lock_stat 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static struct ctl_table kern_lockdep_table[] = {
|
||||
#ifdef CONFIG_PROVE_LOCKING
|
||||
{
|
||||
.procname = "prove_locking",
|
||||
.data = &prove_locking,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
#endif /* CONFIG_PROVE_LOCKING */
|
||||
#ifdef CONFIG_LOCK_STAT
|
||||
{
|
||||
.procname = "lock_stat",
|
||||
.data = &lock_stat,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
#endif /* CONFIG_LOCK_STAT */
|
||||
{ }
|
||||
};
|
||||
|
||||
static __init int kernel_lockdep_sysctls_init(void)
|
||||
{
|
||||
register_sysctl_init("kernel", kern_lockdep_table);
|
||||
return 0;
|
||||
}
|
||||
late_initcall(kernel_lockdep_sysctls_init);
|
||||
#endif /* CONFIG_SYSCTL */
|
||||
|
||||
DEFINE_PER_CPU(unsigned int, lockdep_recursion);
|
||||
EXPORT_PER_CPU_SYMBOL_GPL(lockdep_recursion);
|
||||
|
||||
|
|
|
@ -92,9 +92,6 @@
|
|||
#ifdef CONFIG_RT_MUTEXES
|
||||
#include <linux/rtmutex.h>
|
||||
#endif
|
||||
#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
|
||||
#include <linux/lockdep.h>
|
||||
#endif
|
||||
#ifdef CONFIG_CHR_DEV_SG
|
||||
#include <scsi/sg.h>
|
||||
#endif
|
||||
|
@ -1723,24 +1720,6 @@ static struct ctl_table kern_table[] = {
|
|||
.extra2 = SYSCTL_FOUR,
|
||||
},
|
||||
#endif /* CONFIG_NUMA_BALANCING */
|
||||
#ifdef CONFIG_PROVE_LOCKING
|
||||
{
|
||||
.procname = "prove_locking",
|
||||
.data = &prove_locking,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_LOCK_STAT
|
||||
{
|
||||
.procname = "lock_stat",
|
||||
.data = &lock_stat,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.procname = "panic",
|
||||
.data = &panic_timeout,
|
||||
|
|
Loading…
Reference in New Issue