Skip to contentSkip to conversation

kernel/time: move timer sysctls to its own file

PATCH Applied tangmeng 2 participants 2 messages Feb 15, 2022 – Apr 10, 2022

Subsystems (3)
lore
Share & tools
lore

tangmeng

author
#0 lore raw

PATCH v7 1/1 kernel/time: move timer 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.

Now, all filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs.

So move the timer_migration sysctls to its own file.

---
 include/linux/timer.h |  8 -------
 kernel/sysctl.c       | 11 ---------
 kernel/time/timer.c   | 54 ++++++++++++++++++++++++++++++++-----------
 3 files changed, 40 insertions(+), 33 deletions(-)
include/linux/timer.h +0 -8
index fda13c9d1256..648f00105f58 100644
@@ -196,14 +196,6 @@ extern void init_timers(void);
 struct hrtimer;
 extern enum hrtimer_restart it_real_fn(struct hrtimer *);
 
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-struct ctl_table;
-
-extern unsigned int sysctl_timer_migration;
-int timer_migration_handler(struct ctl_table *table, int write,
-			    void *buffer, size_t *lenp, loff_t *ppos);
-#endif
-
 unsigned long __round_jiffies(unsigned long j, int cpu);
 unsigned long __round_jiffies_relative(unsigned long j, int cpu);
 unsigned long round_jiffies(unsigned long j);
kernel/sysctl.c +0 -11
index 083be6af29d7..740c34f20235 100644
@@ -2656,17 +2656,6 @@ static struct ctl_table kern_table[] = {
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_ONE,
 	},
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-	{
-		.procname	= "timer_migration",
-		.data		= &sysctl_timer_migration,
-		.maxlen		= sizeof(unsigned int),
-		.mode		= 0644,
-		.proc_handler	= timer_migration_handler,
-		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
-	},
-#endif
 #ifdef CONFIG_BPF_SYSCALL
 	{
 		.procname	= "unprivileged_bpf_disabled",
kernel/time/timer.c +40 -14

78 lines not on this page · raw message

Signature · 1 line
2.20.1
merge bot Applied
#1 lore raw

[tip: timers/core] timers: Move timer sysctl into the timer code

The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     efaa0227f6c6a5073951b20cf2f8c63c4155306c
Gitweb:        https://git.kernel.org/tip/efaa0227f6c6a5073951b20cf2f8c63c4155306c
Author:        tangmeng <[email protected]>
AuthorDate:    Tue, 15 Feb 2022 14:50:19 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Sun, 10 Apr 2022 12:38:45 +02:00

timers: Move timer sysctl into the timer code

This is part of the effort to reduce kernel/sysctl.c to only contain the core logic.

---
 include/linux/timer.h |  8 +------
 kernel/sysctl.c       | 11 +---------
 kernel/time/timer.c   | 53 ++++++++++++++++++++++++++++++------------
 3 files changed, 38 insertions(+), 34 deletions(-)
include/linux/timer.h +0 -8
index fda13c9..648f001 100644
@@ -196,14 +196,6 @@ extern void init_timers(void);
 struct hrtimer;
 extern enum hrtimer_restart it_real_fn(struct hrtimer *);
 
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-struct ctl_table;
-
-extern unsigned int sysctl_timer_migration;
-int timer_migration_handler(struct ctl_table *table, int write,
-			    void *buffer, size_t *lenp, loff_t *ppos);
-#endif
-
 unsigned long __round_jiffies(unsigned long j, int cpu);
 unsigned long __round_jiffies_relative(unsigned long j, int cpu);
 unsigned long round_jiffies(unsigned long j);
kernel/sysctl.c +0 -11
index 830aaf8..5b7b1a8 100644
@@ -2288,17 +2288,6 @@ static struct ctl_table kern_table[] = {
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_ONE,
 	},
-#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
-	{
-		.procname	= "timer_migration",
-		.data		= &sysctl_timer_migration,
-		.maxlen		= sizeof(unsigned int),
-		.mode		= 0644,
-		.proc_handler	= timer_migration_handler,
-		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
-	},
-#endif
 #ifdef CONFIG_BPF_SYSCALL
 	{
 		.procname	= "unprivileged_bpf_disabled",
kernel/time/timer.c +38 -15

77 lines not on this page · raw message