linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 5.18 missing /proc/sys/kernel/sched_autogroup_enabled?
@ 2022-05-29 23:52 Ivan Kozik
  2022-05-30  7:45 ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kozik @ 2022-05-29 23:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: nizhen, peterz, mingo

Hello,

I noticed that /proc/sys/kernel/sched_autogroup_enabled seems to have
gone missing in 5.18. Am I doing something wrong, or is this a
regression?

I also noticed that booting 5.18 with "noautogroup" results in a
"kernel: failed when register_sysctl sched_autogroup_sysctls to
kernel" message.  Because of the error and the missing
/proc/sys/kernel/sched_autogroup_enabled, it is unclear whether
autogroup is enabled or not.

Please see below for my testing. These kernels came from
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18/ but I saw the
same thing with a 5.18.0 on NixOS.

Best regards,

Ivan



5.17, default:

at@ubuntu2204:~$ uname -a
Linux ubuntu2204 5.17.11-051711-generic #202205251331 SMP PREEMPT Wed
May 25 13:57:33 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

at@ubuntu2204:~$ journalctl -b | grep -i autogroup

at@ubuntu2204:~$ cat /proc/sys/kernel/sched_autogroup_enabled
1



5.17, noautogroup:

at@ubuntu2204:~$ uname -a
Linux ubuntu2204 5.17.11-051711-generic #202205251331 SMP PREEMPT Wed
May 25 13:57:33 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

at@ubuntu2204:~$ journalctl -b | grep -i autogroup
May 29 15:58:17 ubuntu2204 kernel: Command line:
BOOT_IMAGE=/boot/vmlinuz-5.17.11-051711-generic
root=UUID=20672a55-02fc-49b3-8c04-bd040f068096 ro
find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
quiet splash noautogroup
May 29 15:58:17 ubuntu2204 kernel: Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-5.17.11-051711-generic
root=UUID=20672a55-02fc-49b3-8c04-bd040f068096 ro
find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
quiet splash noautogroup

at@ubuntu2204:~$ cat /proc/sys/kernel/sched_autogroup_enabled
0



5.18, default:

at@ubuntu2204:~$ uname -a
Linux ubuntu2204 5.18.0-051800-generic #202205222030 SMP
PREEMPT_DYNAMIC Sun May 22 20:33:46 UTC 2022 x86_64 x86_64 x86_64
GNU/Linux

at@ubuntu2204:~$ journalctl -b | grep -i autogroup

at@ubuntu2204:~$ cat /proc/sys/kernel/sched_autogroup_enabled
cat: /proc/sys/kernel/sched_autogroup_enabled: No such file or directory

root@ubuntu2204:~# sysctl -a | grep -i autogroup



5.18, noautogroup:

at@ubuntu2204:~$ uname -a
Linux ubuntu2204 5.18.0-051800-generic #202205222030 SMP
PREEMPT_DYNAMIC Sun May 22 20:33:46 UTC 2022 x86_64 x86_64 x86_64
GNU/Linux

at@ubuntu2204:~$ journalctl -b | grep -i autogroup
May 29 15:53:17 ubuntu2204 kernel: Command line:
BOOT_IMAGE=/boot/vmlinuz-5.18.0-051800-generic
root=UUID=20672a55-02fc-49b3-8c04-bd040f068096 ro
find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
quiet splash noautogroup
May 29 15:53:17 ubuntu2204 kernel: Kernel command line:
BOOT_IMAGE=/boot/vmlinuz-5.18.0-051800-generic
root=UUID=20672a55-02fc-49b3-8c04-bd040f068096 ro
find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US
quiet splash noautogroup
May 29 15:53:17 ubuntu2204 kernel: failed when register_sysctl
sched_autogroup_sysctls to kernel

at@ubuntu2204:~$ cat /proc/sys/kernel/sched_autogroup_enabled
cat: /proc/sys/kernel/sched_autogroup_enabled: No such file or directory



root@ubuntu2204:~# cat /boot/config-5.1[78]* | grep -i config_sysctl=
CONFIG_SYSCTL=y
CONFIG_SYSCTL=y

root@ubuntu2204:~# cat /boot/config-5.1[78]* | grep -i autogroup
CONFIG_SCHED_AUTOGROUP=y
CONFIG_SCHED_AUTOGROUP=y

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 5.18 missing /proc/sys/kernel/sched_autogroup_enabled?
  2022-05-29 23:52 5.18 missing /proc/sys/kernel/sched_autogroup_enabled? Ivan Kozik
@ 2022-05-30  7:45 ` Peter Zijlstra
  2022-05-30  9:48   ` Ivan Kozik
  2022-05-30 10:45   ` [tip: sched/urgent] sched/autogroup: Fix sysctl move tip-bot2 for Peter Zijlstra
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2022-05-30  7:45 UTC (permalink / raw)
  To: Ivan Kozik; +Cc: linux-kernel, nizhen, mingo

On Sun, May 29, 2022 at 11:52:42PM +0000, Ivan Kozik wrote:
> Hello,
> 
> I noticed that /proc/sys/kernel/sched_autogroup_enabled seems to have
> gone missing in 5.18. Am I doing something wrong, or is this a
> regression?
> 
> I also noticed that booting 5.18 with "noautogroup" results in a
> "kernel: failed when register_sysctl sched_autogroup_sysctls to
> kernel" message.  Because of the error and the missing
> /proc/sys/kernel/sched_autogroup_enabled, it is unclear whether
> autogroup is enabled or not.

*sigh*, I think this is yet another one of the sysctl move patches gone
bad :/ Specifically:

 c8eaf6ac76f4 ("sched: move autogroup sysctls into its own file")

Does something like the below help?

---

diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c
index 16092b49ff6a..4ebaf97f7bd8 100644
--- a/kernel/sched/autogroup.c
+++ b/kernel/sched/autogroup.c
@@ -36,6 +36,7 @@ void __init autogroup_init(struct task_struct *init_task)
 	kref_init(&autogroup_default.kref);
 	init_rwsem(&autogroup_default.lock);
 	init_task->signal->autogroup = &autogroup_default;
+	sched_autogroup_sysctl_init();
 }
 
 void autogroup_free(struct task_group *tg)
@@ -219,7 +220,6 @@ void sched_autogroup_exit(struct signal_struct *sig)
 static int __init setup_autogroup(char *str)
 {
 	sysctl_sched_autogroup_enabled = 0;
-	sched_autogroup_sysctl_init();
 
 	return 1;
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: 5.18 missing /proc/sys/kernel/sched_autogroup_enabled?
  2022-05-30  7:45 ` Peter Zijlstra
@ 2022-05-30  9:48   ` Ivan Kozik
  2022-05-30 10:45   ` [tip: sched/urgent] sched/autogroup: Fix sysctl move tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 4+ messages in thread
From: Ivan Kozik @ 2022-05-30  9:48 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, nizhen, mingo

On Mon, May 30, 2022 at 7:45 AM Peter Zijlstra <peterz@infradead.org> wrote:
> *sigh*, I think this is yet another one of the sysctl move patches gone
> bad :/ Specifically:
>
>  c8eaf6ac76f4 ("sched: move autogroup sysctls into its own file")
>
> Does something like the below help?

Hi Peter,

Yes, your patch does fix both the missing
/proc/sys/kernel/sched_autogroup_enabled and the error when using
noautogroup.

Thank you,

Ivan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: sched/urgent] sched/autogroup: Fix sysctl move
  2022-05-30  7:45 ` Peter Zijlstra
  2022-05-30  9:48   ` Ivan Kozik
@ 2022-05-30 10:45   ` tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2022-05-30 10:45 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ivan Kozik, Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     82f586f923e3ac6062bc7867717a7f8afc09e0ff
Gitweb:        https://git.kernel.org/tip/82f586f923e3ac6062bc7867717a7f8afc09e0ff
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Mon, 30 May 2022 09:45:38 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 30 May 2022 12:36:36 +02:00

sched/autogroup: Fix sysctl move

Ivan reported /proc/sys/kernel/sched_autogroup_enabled went walk-about
and using the noautogroup command line parameter would result in a
boot error message.

Turns out the sysctl move placed the init function wrong.

Fixes: c8eaf6ac76f4 ("sched: move autogroup sysctls into its own file")
Reported-by: Ivan Kozik <ivan@ludios.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Ivan Kozik <ivan@ludios.org>
Link: https://lkml.kernel.org/r/YpR2IqndgsyMzN00@worktop.programming.kicks-ass.net
---
 kernel/sched/autogroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c
index 16092b4..4ebaf97 100644
--- a/kernel/sched/autogroup.c
+++ b/kernel/sched/autogroup.c
@@ -36,6 +36,7 @@ void __init autogroup_init(struct task_struct *init_task)
 	kref_init(&autogroup_default.kref);
 	init_rwsem(&autogroup_default.lock);
 	init_task->signal->autogroup = &autogroup_default;
+	sched_autogroup_sysctl_init();
 }
 
 void autogroup_free(struct task_group *tg)
@@ -219,7 +220,6 @@ void sched_autogroup_exit(struct signal_struct *sig)
 static int __init setup_autogroup(char *str)
 {
 	sysctl_sched_autogroup_enabled = 0;
-	sched_autogroup_sysctl_init();
 
 	return 1;
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-30 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-29 23:52 5.18 missing /proc/sys/kernel/sched_autogroup_enabled? Ivan Kozik
2022-05-30  7:45 ` Peter Zijlstra
2022-05-30  9:48   ` Ivan Kozik
2022-05-30 10:45   ` [tip: sched/urgent] sched/autogroup: Fix sysctl move tip-bot2 for Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).