diff mbox series

[v2,6/6] s390: mv s390 sysctls into their own file under arch/s390 dir

Message ID 20250306-jag-mv_ctltables-v2-6-71b243c8d3f8@kernel.org (mailing list archive)
State New
Headers show
Series sysctl: Move sysctls from kern_table into their respective subsystems | expand

Commit Message

Joel Granados March 6, 2025, 11:29 a.m. UTC
Move s390 sysctls (spin_retry and userprocess_debug) into their own
files under arch/s390. We 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>
---
 arch/s390/lib/spinlock.c | 18 ++++++++++++++++++
 arch/s390/mm/fault.c     | 17 +++++++++++++++++
 kernel/sysctl.c          | 18 ------------------
 3 files changed, 35 insertions(+), 18 deletions(-)

Comments

Heiko Carstens March 7, 2025, 3:26 p.m. UTC | #1
On Thu, Mar 06, 2025 at 12:29:46PM +0100, joel granados wrote:
> Move s390 sysctls (spin_retry and userprocess_debug) into their own
> files under arch/s390. We 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>
> ---
>  arch/s390/lib/spinlock.c | 18 ++++++++++++++++++
>  arch/s390/mm/fault.c     | 17 +++++++++++++++++
>  kernel/sysctl.c          | 18 ------------------
>  3 files changed, 35 insertions(+), 18 deletions(-)

Acked-by: Heiko Carstens <hca@linux.ibm.com>

How should this go upstream? Will you take care of this, or should
this go via the s390 tree?
Joel Granados March 10, 2025, 1:41 p.m. UTC | #2
On Fri, Mar 07, 2025 at 04:26:20PM +0100, Heiko Carstens wrote:
> On Thu, Mar 06, 2025 at 12:29:46PM +0100, joel granados wrote:
> > Move s390 sysctls (spin_retry and userprocess_debug) into their own
> > files under arch/s390. We 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>
> > ---
> >  arch/s390/lib/spinlock.c | 18 ++++++++++++++++++
> >  arch/s390/mm/fault.c     | 17 +++++++++++++++++
> >  kernel/sysctl.c          | 18 ------------------
> >  3 files changed, 35 insertions(+), 18 deletions(-)
> 
> Acked-by: Heiko Carstens <hca@linux.ibm.com>
> 
> How should this go upstream? Will you take care of this, or should
> this go via the s390 tree?

thx for the review

It would be great if you can push it through the s390 tree. However, if
it is not possible to do so, please let me know and I'll add it to the
sysctl-next changes.

Best
Vasily Gorbik March 11, 2025, 11:02 a.m. UTC | #3
On Mon, Mar 10, 2025 at 02:41:59PM +0100, Joel Granados wrote:
> On Fri, Mar 07, 2025 at 04:26:20PM +0100, Heiko Carstens wrote:
> > On Thu, Mar 06, 2025 at 12:29:46PM +0100, joel granados wrote:
> > > Move s390 sysctls (spin_retry and userprocess_debug) into their own
> > > files under arch/s390. We 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>
> > > ---
> > >  arch/s390/lib/spinlock.c | 18 ++++++++++++++++++
> > >  arch/s390/mm/fault.c     | 17 +++++++++++++++++
> > >  kernel/sysctl.c          | 18 ------------------
> > >  3 files changed, 35 insertions(+), 18 deletions(-)
> > 
> > Acked-by: Heiko Carstens <hca@linux.ibm.com>
> > 
> > How should this go upstream? Will you take care of this, or should
> > this go via the s390 tree?
> 
> thx for the review
> 
> It would be great if you can push it through the s390 tree. However, if
> it is not possible to do so, please let me know and I'll add it to the
> sysctl-next changes.

I've slightly changed the commit message
s390: Move s390 sysctls into their own file under arch/s390

And applied, thank you!
diff mbox series

Patch

diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index a81a01c449272ebad77cb031992078ac8e255eb8..6870b9e03456c34a1dc5c0c706f8e8bf1c4140e8 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -16,6 +16,7 @@ 
 #include <linux/io.h>
 #include <asm/alternative.h>
 #include <asm/asm.h>
+#include <linux/sysctl.h>
 
 int spin_retry = -1;
 
@@ -37,6 +38,23 @@  static int __init spin_retry_setup(char *str)
 }
 __setup("spin_retry=", spin_retry_setup);
 
+static const struct ctl_table s390_spin_sysctl_table[] = {
+	{
+		.procname	= "spin_retry",
+		.data		= &spin_retry,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec,
+	},
+};
+
+static int __init init_s390_spin_sysctls(void)
+{
+	register_sysctl_init("kernel", s390_spin_sysctl_table);
+	return 0;
+}
+arch_initcall(init_s390_spin_sysctls);
+
 struct spin_wait {
 	struct spin_wait *next, *prev;
 	int node_id;
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 9b681f74dccc1f525bafe150acf91e666a60d2bd..507da355bf68271c30115a797368f950707a2d8e 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -175,6 +175,23 @@  static void dump_fault_info(struct pt_regs *regs)
 
 int show_unhandled_signals = 1;
 
+static const struct ctl_table s390_fault_sysctl_table[] = {
+	{
+		.procname	= "userprocess_debug",
+		.data		= &show_unhandled_signals,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec,
+	},
+};
+
+static int __init init_s390_fault_sysctls(void)
+{
+	register_sysctl_init("kernel", s390_fault_sysctl_table);
+	return 0;
+}
+arch_initcall(init_s390_fault_sysctls);
+
 void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault)
 {
 	static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0dc41eea1dbd34396c323118cfd0e3133c6993a1..34c525ad0e0e0fe3b64c2ec730e443a75b55f3a3 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1709,15 +1709,6 @@  static const struct ctl_table kern_table[] = {
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_MAXOLDUID,
 	},
-#ifdef CONFIG_S390
-	{
-		.procname	= "userprocess_debug",
-		.data		= &show_unhandled_signals,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
-#endif
 	{
 		.procname	= "ngroups_max",
 		.data		= (void *)&ngroups_max,
@@ -1798,15 +1789,6 @@  static const struct ctl_table kern_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 #endif
-#if defined(CONFIG_S390) && defined(CONFIG_SMP)
-	{
-		.procname	= "spin_retry",
-		.data		= &spin_retry,
-		.maxlen		= sizeof (int),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	},
-#endif
 #if	defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
 	{
 		.procname	= "acpi_video_flags",