From 1f1e86736f0f077f809e5bd61d9162755bd80b5f Mon Sep 17 00:00:00 2001 From: Patsy Griffin Date: Fri, 11 Jul 2025 14:42:29 -0400 Subject: [PATCH] sched(7): Mention autogroup disabled behavior. Resolves: RHEL-67690 --- 0000-sched.7-Clarifications-corrections.patch | 76 +++++++++++++++++++ man-pages.spec | 10 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 0000-sched.7-Clarifications-corrections.patch diff --git a/0000-sched.7-Clarifications-corrections.patch b/0000-sched.7-Clarifications-corrections.patch new file mode 100644 index 0000000..3bb36da --- /dev/null +++ b/0000-sched.7-Clarifications-corrections.patch @@ -0,0 +1,76 @@ +commit ca69daf45f94fda061f796efcc4f24ca76d8e380 +Author: Phil Auld +Date: Thu Jan 16 14:37:47 2025 +0000 + + man/man7/sched.7: Mention autogroup disabled behavior + + The autogroup feature can be contolled at runtime when built into the + kernel. Disabling it in this case still creates autogroups and still + shows the autogroup membership for the task in /proc. The scheduler + code will just not use the the autogroup task group. This can be + confusing to users. Add a sentence to this effect to sched.7 to point + this out. + + The kernel code shows how this is used. The sched_autogroup_enabled + toggle is only used in one place. + + kernel/sched/autogroup.h: + + static inline struct task_group * + autogroup_task_group(struct task_struct *p, struct task_group *tg) + { + extern unsigned int sysctl_sched_autogroup_enabled; + int enabled = READ_ONCE(sysctl_sched_autogroup_enabled); + + if (enabled && task_wants_autogroup(p, tg)) + return p->signal->autogroup->tg; + + return tg; + } + + task_wants_autogroup() is in kernel/sched/autogroup.c: + + bool task_wants_autogroup(struct task_struct *p, struct task_group *tg) + { + if (tg != &root_task_group) + return false; + ... + + return true; + } + + One can see that any group set other than root also bypasses the use of + the autogroup. All of the machinery around the creation of the + autogroup is not effected by the toggle. + + From userspace: + 0 + /autogroup-112 nice 0 + + Note, systemd based system these days is not really using autogroups at + all anyway because any task in a non-root cgroup bypasses the autogroup + as well. + + Cc: Carlos O'Donell + Signed-off-by: Phil Auld + Message-ID: <20250116143747.2366152-1-pauld@redhat.com> + Signed-off-by: Alejandro Colomar + +Conflicts: + man7/sched.7 - one line .P vs .PP difference + +diff -Nrup a/man7/sched.7 b/man7/sched.7 +--- a/man7/sched.7 2023-04-02 20:27:35.000000000 -0400 ++++ b/man7/sched.7 2025-07-08 14:20:38.627388430 -0400 +@@ -724,6 +724,11 @@ in the group terminates. + .PP + When autogrouping is enabled, all of the members of an autogroup + are placed in the same kernel scheduler "task group". ++When disabled, ++the group creation happens as above, ++and autogroup membership is still visible in ++.IR /proc , ++but the autogroups are not used. + The CFS scheduler employs an algorithm that equalizes the + distribution of CPU cycles across task groups. + The benefits of this for interactive desktop performance diff --git a/man-pages.spec b/man-pages.spec index c481523..d2e2060 100644 --- a/man-pages.spec +++ b/man-pages.spec @@ -8,7 +8,7 @@ Summary: Linux kernel and C library user-space interface documentation Name: man-pages Version: 6.04 -Release: 4%{?dist} +Release: 5%{?dist} # List of licenses with examples of man-pages using them # BSD-2-Clause: man-pages/man5/elf.5 # BSD-3-Clause: man-pages/man3/list.3 @@ -69,6 +69,9 @@ Patch24: 0001-ctime.3-Move-NOTES-to-a-subsection-within-CAVEATS.patch Patch25: 0002-ctime.3-CAVEATS-Add-note-about-tm_isdst-handling-in-.patch Patch26: 0003-ctime.3-EXAMPLES-Document-how-to-detect-invalid-or-ambiguous-times.patch +# Upstream patch providing sched(7) corrections/clarifications +Patch27: 0000-sched.7-Clarifications-corrections.patch + %description A large collection of manual pages from the Linux Documentation Project (LDP). @@ -81,6 +84,7 @@ A large collection of manual pages from the Linux Documentation Project (LDP). %patch -p1 -P 24 %patch -p1 -P 25 %patch -p1 -P 26 +%patch -p1 -P 27 # rename posix README so we don't have conflict mv %{posix_name}/README %{posix_name}/%{posix_name_rel}.README @@ -146,6 +150,10 @@ fi %{_mandir}/man*/* %changelog +* Fri Jul 11 2025 Patsy Griffin - 6.04-5 +- sched(7): Mention autogroup disabled behavior. + Resolves: RHEL-67690 + * Wed Jun 18 2025 Patsy Griffin - 6.04-4 - Activate previously added patch to improve mktime documentation and add 3 related upstream patches including an example.