* [PATCH 0/2] cgroup, docs: Clarify interaction of RT processes with cgroup v2 cpu controller
@ 2025-03-05 4:12 Shashank Balaji via B4 Relay
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
2025-03-05 4:12 ` [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Shashank Balaji via B4 Relay
0 siblings, 2 replies; 13+ messages in thread
From: Shashank Balaji via B4 Relay @ 2025-03-05 4:12 UTC (permalink / raw)
To: Tejun Heo, Johannes Weiner, Michal Koutný, Jonathan Corbet
Cc: Waiman Long, cgroups, linux-doc, linux-kernel, Shinya Takumi,
Shashank Balaji
Currently, CONFIG_RT_GROUP_SCHED is practically unusable. If enabled,
the cpu controller can be enabled only when all the realtime processes are in
the root cgroup. This has been clarified by Waiman Long in commit
20d4628 (cgroup, docs: Clarify limitation of RT processes with cgroup v2
cpu controller): https://lore.kernel.org/lkml/20240320142302.1790171-1-longman@redhat.com/
But this limitation does not affect any of the other controllers:
irrespective of CONFIG_RT_GROUP_SCHED, the other controllers can be used
for the resource control of realtime processes. This is made more
explicit in the first patch.
Even when CONFIG_RT_GROUP_SCHED is disabled, the runtime of realtime
processes is accounted for by cpu.pressure, and the usage_usec, user_usec,
and system_usec fields of cpu.stat, and cpu.uclamp.{min, max} affect
realtime processes as well. This is documented in the second patch.
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
---
Shashank Balaji (2):
cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers
cgroup, docs: Document interaction of RT processes with cpu controller
Documentation/admin-guide/cgroup-v2.rst | 41 ++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 14 deletions(-)
---
base-commit: 9b381a28f44a49b92b03bb3982728f9cb67ee225
change-id: 20250226-rt-and-cpu-controller-doc-8a8aac572f3e
Best regards,
--
Shashank Balaji <shashank.mahadasyam@sony.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers
2025-03-05 4:12 [PATCH 0/2] cgroup, docs: Clarify interaction of RT processes with cgroup v2 cpu controller Shashank Balaji via B4 Relay
@ 2025-03-05 4:12 ` Shashank Balaji via B4 Relay
2025-03-05 14:13 ` Waiman Long
` (2 more replies)
2025-03-05 4:12 ` [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Shashank Balaji via B4 Relay
1 sibling, 3 replies; 13+ messages in thread
From: Shashank Balaji via B4 Relay @ 2025-03-05 4:12 UTC (permalink / raw)
To: Tejun Heo, Johannes Weiner, Michal Koutný, Jonathan Corbet
Cc: Waiman Long, cgroups, linux-doc, linux-kernel, Shinya Takumi,
Shashank Balaji
From: Shashank Balaji <shashank.mahadasyam@sony.com>
The cgroup v2 cpu controller has a limitation that if
CONFIG_RT_GROUP_SCHED is enabled, the cpu controller can be enabled only
if all the realtime processes are in the root cgroup. The other
controllers have no such restriction. They can be used for the resource
control of realtime processes irrespective of whether
CONFIG_RT_GROUP_SCHED is enabled or not.
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
---
Documentation/admin-guide/cgroup-v2.rst | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index cb1b4e759b7e267c24d7f4f69564c16fb29c4d89..f293a13b42ed69e7c6bf5e974cb86e228411af4e 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1076,15 +1076,20 @@ cpufreq governor about the minimum desired frequency which should always be
provided by a CPU, as well as the maximum desired frequency, which should not
be exceeded by a CPU.
-WARNING: cgroup2 doesn't yet support control of realtime processes. For
-a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group
-scheduling of realtime processes, the cpu controller can only be enabled
-when all RT processes are in the root cgroup. This limitation does
-not apply if CONFIG_RT_GROUP_SCHED is disabled. Be aware that system
-management software may already have placed RT processes into nonroot
-cgroups during the system boot process, and these processes may need
-to be moved to the root cgroup before the cpu controller can be enabled
-with a CONFIG_RT_GROUP_SCHED enabled kernel.
+WARNING: cgroup2 cpu controller doesn't yet fully support the control of
+realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED option
+enabled for group scheduling of realtime processes, the cpu controller can only
+be enabled when all RT processes are in the root cgroup. Be aware that system
+management software may already have placed RT processes into non-root cgroups
+during the system boot process, and these processes may need to be moved to the
+root cgroup before the cpu controller can be enabled with a
+CONFIG_RT_GROUP_SCHED enabled kernel.
+
+With CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and some of
+the interface files either affect realtime processes or account for them. See
+the following section for details. Only the cpu controller is affected by
+CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource control of
+realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
CPU Interface Files
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
@ 2025-03-05 14:13 ` Waiman Long
2025-03-05 16:15 ` Michal Koutný
2025-03-05 18:44 ` Tejun Heo
2 siblings, 0 replies; 13+ messages in thread
From: Waiman Long @ 2025-03-05 14:13 UTC (permalink / raw)
To: shashank.mahadasyam, Tejun Heo, Johannes Weiner,
Michal Koutný,
Jonathan Corbet
Cc: cgroups, linux-doc, linux-kernel, Shinya Takumi
On 3/4/25 11:12 PM, Shashank Balaji via B4 Relay wrote:
> From: Shashank Balaji <shashank.mahadasyam@sony.com>
>
> The cgroup v2 cpu controller has a limitation that if
> CONFIG_RT_GROUP_SCHED is enabled, the cpu controller can be enabled only
> if all the realtime processes are in the root cgroup. The other
> controllers have no such restriction. They can be used for the resource
> control of realtime processes irrespective of whether
> CONFIG_RT_GROUP_SCHED is enabled or not.
>
> Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
> ---
> Documentation/admin-guide/cgroup-v2.rst | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index cb1b4e759b7e267c24d7f4f69564c16fb29c4d89..f293a13b42ed69e7c6bf5e974cb86e228411af4e 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1076,15 +1076,20 @@ cpufreq governor about the minimum desired frequency which should always be
> provided by a CPU, as well as the maximum desired frequency, which should not
> be exceeded by a CPU.
>
> -WARNING: cgroup2 doesn't yet support control of realtime processes. For
> -a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group
> -scheduling of realtime processes, the cpu controller can only be enabled
> -when all RT processes are in the root cgroup. This limitation does
> -not apply if CONFIG_RT_GROUP_SCHED is disabled. Be aware that system
> -management software may already have placed RT processes into nonroot
> -cgroups during the system boot process, and these processes may need
> -to be moved to the root cgroup before the cpu controller can be enabled
> -with a CONFIG_RT_GROUP_SCHED enabled kernel.
> +WARNING: cgroup2 cpu controller doesn't yet fully support the control of
> +realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED option
> +enabled for group scheduling of realtime processes, the cpu controller can only
> +be enabled when all RT processes are in the root cgroup. Be aware that system
> +management software may already have placed RT processes into non-root cgroups
> +during the system boot process, and these processes may need to be moved to the
> +root cgroup before the cpu controller can be enabled with a
> +CONFIG_RT_GROUP_SCHED enabled kernel.
> +
> +With CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and some of
> +the interface files either affect realtime processes or account for them. See
> +the following section for details. Only the cpu controller is affected by
> +CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource control of
> +realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
>
>
> CPU Interface Files
LGTM
Acked-by: Waiman Long <longman@redhat.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
2025-03-05 14:13 ` Waiman Long
@ 2025-03-05 16:15 ` Michal Koutný
2025-03-05 18:44 ` Tejun Heo
2 siblings, 0 replies; 13+ messages in thread
From: Michal Koutný @ 2025-03-05 16:15 UTC (permalink / raw)
To: shashank.mahadasyam
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya Takumi
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
On Wed, Mar 05, 2025 at 01:12:43PM +0900, Shashank Balaji via B4 Relay <devnull+shashank.mahadasyam.sony.com@kernel.org> wrote:
> From: Shashank Balaji <shashank.mahadasyam@sony.com>
>
> The cgroup v2 cpu controller has a limitation that if
> CONFIG_RT_GROUP_SCHED is enabled, the cpu controller can be enabled only
> if all the realtime processes are in the root cgroup. The other
> controllers have no such restriction. They can be used for the resource
> control of realtime processes irrespective of whether
> CONFIG_RT_GROUP_SCHED is enabled or not.
>
> Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
> ---
> Documentation/admin-guide/cgroup-v2.rst | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
Acked-by: Michal Koutný <mkoutny@suse.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
2025-03-05 14:13 ` Waiman Long
2025-03-05 16:15 ` Michal Koutný
@ 2025-03-05 18:44 ` Tejun Heo
2 siblings, 0 replies; 13+ messages in thread
From: Tejun Heo @ 2025-03-05 18:44 UTC (permalink / raw)
To: shashank.mahadasyam
Cc: Johannes Weiner, Michal Koutný,
Jonathan Corbet, Waiman Long, cgroups, linux-doc, linux-kernel,
Shinya Takumi
On Wed, Mar 05, 2025 at 01:12:43PM +0900, Shashank Balaji via B4 Relay wrote:
> From: Shashank Balaji <shashank.mahadasyam@sony.com>
>
> The cgroup v2 cpu controller has a limitation that if
> CONFIG_RT_GROUP_SCHED is enabled, the cpu controller can be enabled only
> if all the realtime processes are in the root cgroup. The other
> controllers have no such restriction. They can be used for the resource
> control of realtime processes irrespective of whether
> CONFIG_RT_GROUP_SCHED is enabled or not.
>
> Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
Applied to cgroup/for-6.15.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-05 4:12 [PATCH 0/2] cgroup, docs: Clarify interaction of RT processes with cgroup v2 cpu controller Shashank Balaji via B4 Relay
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
@ 2025-03-05 4:12 ` Shashank Balaji via B4 Relay
2025-03-05 14:16 ` Waiman Long
2025-03-05 16:19 ` Michal Koutný
1 sibling, 2 replies; 13+ messages in thread
From: Shashank Balaji via B4 Relay @ 2025-03-05 4:12 UTC (permalink / raw)
To: Tejun Heo, Johannes Weiner, Michal Koutný, Jonathan Corbet
Cc: Waiman Long, cgroups, linux-doc, linux-kernel, Shinya Takumi,
Shashank Balaji
From: Shashank Balaji <shashank.mahadasyam@sony.com>
If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED
disabled setting, cpu.stat and cpu.pressure account for realtime
processes, and cpu.uclamp.{min, max} affect realtime processes as well.
None of the other interface files are affected by or affect realtime
processes.
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
---
Documentation/admin-guide/cgroup-v2.rst | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index f293a13b42ed69e7c6bf5e974cb86e228411af4e..2c267f42e5fef9c4e2c3530ce73330d680b9b2dc 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1095,7 +1095,9 @@ realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
CPU Interface Files
~~~~~~~~~~~~~~~~~~~
-All time durations are in microseconds.
+All time durations are in microseconds. Only cpu.stat and cpu.pressure account
+for realtime processes, and only cpu.uclamp.min and cpu.uclamp.max
+affect realtime processes.
cpu.stat
A read-only flat-keyed file.
@@ -1115,6 +1117,9 @@ All time durations are in microseconds.
- nr_bursts
- burst_usec
+ The runtime of realtime processes is accounted for only by the usage_usec,
+ user_usec, and system_usec fields.
+
cpu.weight
A read-write single value file which exists on non-root
cgroups. The default is "100".
@@ -1158,8 +1163,9 @@ All time durations are in microseconds.
cpu.pressure
A read-write nested-keyed file.
- Shows pressure stall information for CPU. See
- :ref:`Documentation/accounting/psi.rst <psi>` for details.
+ Shows pressure stall information for CPU, including the contribution of
+ realtime processes. See :ref:`Documentation/accounting/psi.rst <psi>`
+ for details.
cpu.uclamp.min
A read-write single value file which exists on non-root cgroups.
@@ -1170,7 +1176,8 @@ All time durations are in microseconds.
This interface allows reading and setting minimum utilization clamp
values similar to the sched_setattr(2). This minimum utilization
- value is used to clamp the task specific minimum utilization clamp.
+ value is used to clamp the task specific minimum utilization clamp,
+ including those of realtime processes.
The requested minimum utilization (protection) is always capped by
the current value for the maximum utilization (limit), i.e.
@@ -1185,7 +1192,8 @@ All time durations are in microseconds.
This interface allows reading and setting maximum utilization clamp
values similar to the sched_setattr(2). This maximum utilization
- value is used to clamp the task specific maximum utilization clamp.
+ value is used to clamp the task specific maximum utilization clamp,
+ including those of realtime processes.
cpu.idle
A read-write single value file which exists on non-root cgroups.
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-05 4:12 ` [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Shashank Balaji via B4 Relay
@ 2025-03-05 14:16 ` Waiman Long
2025-03-06 10:23 ` Shashank.Mahadasyam
2025-03-05 16:19 ` Michal Koutný
1 sibling, 1 reply; 13+ messages in thread
From: Waiman Long @ 2025-03-05 14:16 UTC (permalink / raw)
To: shashank.mahadasyam, Tejun Heo, Johannes Weiner,
Michal Koutný,
Jonathan Corbet
Cc: cgroups, linux-doc, linux-kernel, Shinya Takumi
On 3/4/25 11:12 PM, Shashank Balaji via B4 Relay wrote:
> From: Shashank Balaji <shashank.mahadasyam@sony.com>
>
> If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED
> disabled setting, cpu.stat and cpu.pressure account for realtime
> processes, and cpu.uclamp.{min, max} affect realtime processes as well.
> None of the other interface files are affected by or affect realtime
> processes.
>
> Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
> ---
> Documentation/admin-guide/cgroup-v2.rst | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index f293a13b42ed69e7c6bf5e974cb86e228411af4e..2c267f42e5fef9c4e2c3530ce73330d680b9b2dc 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1095,7 +1095,9 @@ realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
> CPU Interface Files
> ~~~~~~~~~~~~~~~~~~~
>
> -All time durations are in microseconds.
> +All time durations are in microseconds. Only cpu.stat and cpu.pressure account
> +for realtime processes, and only cpu.uclamp.min and cpu.uclamp.max
> +affect realtime processes.
>
> cpu.stat
> A read-only flat-keyed file.
> @@ -1115,6 +1117,9 @@ All time durations are in microseconds.
> - nr_bursts
> - burst_usec
>
> + The runtime of realtime processes is accounted for only by the usage_usec,
> + user_usec, and system_usec fields.
> +
Alignment problem!
Anyway, I am not familiar enough with these cpu control files to give a
review yet.
Cheers,
Longman
> cpu.weight
> A read-write single value file which exists on non-root
> cgroups. The default is "100".
> @@ -1158,8 +1163,9 @@ All time durations are in microseconds.
> cpu.pressure
> A read-write nested-keyed file.
>
> - Shows pressure stall information for CPU. See
> - :ref:`Documentation/accounting/psi.rst <psi>` for details.
> + Shows pressure stall information for CPU, including the contribution of
> + realtime processes. See :ref:`Documentation/accounting/psi.rst <psi>`
> + for details.
>
> cpu.uclamp.min
> A read-write single value file which exists on non-root cgroups.
> @@ -1170,7 +1176,8 @@ All time durations are in microseconds.
>
> This interface allows reading and setting minimum utilization clamp
> values similar to the sched_setattr(2). This minimum utilization
> - value is used to clamp the task specific minimum utilization clamp.
> + value is used to clamp the task specific minimum utilization clamp,
> + including those of realtime processes.
>
> The requested minimum utilization (protection) is always capped by
> the current value for the maximum utilization (limit), i.e.
> @@ -1185,7 +1192,8 @@ All time durations are in microseconds.
>
> This interface allows reading and setting maximum utilization clamp
> values similar to the sched_setattr(2). This maximum utilization
> - value is used to clamp the task specific maximum utilization clamp.
> + value is used to clamp the task specific maximum utilization clamp,
> + including those of realtime processes.
>
> cpu.idle
> A read-write single value file which exists on non-root cgroups.
>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-05 14:16 ` Waiman Long
@ 2025-03-06 10:23 ` Shashank.Mahadasyam
0 siblings, 0 replies; 13+ messages in thread
From: Shashank.Mahadasyam @ 2025-03-06 10:23 UTC (permalink / raw)
To: Waiman Long
Cc: cgroups, linux-doc, linux-kernel, Shinya.Takumi, Tejun Heo,
Johannes Weiner, Jonathan Corbet, Michal Koutný,
Shashank.Mahadasyam
Hi Longman,
> > From: Shashank Balaji <shashank.mahadasyam@sony.com>
> >
> > If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED
> > disabled setting, cpu.stat and cpu.pressure account for realtime
> > processes, and cpu.uclamp.{min, max} affect realtime processes as well.
> > None of the other interface files are affected by or affect realtime
> > processes.
> >
> > Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
> > ---
> > Documentation/admin-guide/cgroup-v2.rst | 18 +++++++++++++-----
> > 1 file changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> > index f293a13b42ed69e7c6bf5e974cb86e228411af4e..2c267f42e5fef9c4e2c3530ce73330d680b9b2dc 100644
> > --- a/Documentation/admin-guide/cgroup-v2.rst
> > +++ b/Documentation/admin-guide/cgroup-v2.rst
> > @@ -1095,7 +1095,9 @@ realtime processes irrespective of CONFIG_RT_GROUP_SCHED.
> > CPU Interface Files
> > ~~~~~~~~~~~~~~~~~~~
> >
> > -All time durations are in microseconds.
> > +All time durations are in microseconds. Only cpu.stat and cpu.pressure account
> > +for realtime processes, and only cpu.uclamp.min and cpu.uclamp.max
> > +affect realtime processes.
> >
> > cpu.stat
> > A read-only flat-keyed file.
> > @@ -1115,6 +1117,9 @@ All time durations are in microseconds.
> > - nr_bursts
> > - burst_usec
> >
> > + The runtime of realtime processes is accounted for only by the usage_usec,
> > + user_usec, and system_usec fields.
> > +
>
> Alignment problem!
>
> Anyway, I am not familiar enough with these cpu control files to give a
> review yet.
>
> Cheers,
> Longman
My bad, I'll fix the alignment.
Thanks,
Shashank
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-05 4:12 ` [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Shashank Balaji via B4 Relay
2025-03-05 14:16 ` Waiman Long
@ 2025-03-05 16:19 ` Michal Koutný
2025-03-06 11:02 ` Shashank.Mahadasyam
1 sibling, 1 reply; 13+ messages in thread
From: Michal Koutný @ 2025-03-05 16:19 UTC (permalink / raw)
To: shashank.mahadasyam
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya Takumi
[-- Attachment #1: Type: text/plain, Size: 730 bytes --]
Hello Shashank.
On Wed, Mar 05, 2025 at 01:12:44PM +0900, Shashank Balaji via B4 Relay <devnull+shashank.mahadasyam.sony.com@kernel.org> wrote:
> From: Shashank Balaji <shashank.mahadasyam@sony.com>
>
> If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED
> disabled setting, cpu.stat and cpu.pressure account for realtime
> processes, and cpu.uclamp.{min, max} affect realtime processes as well.
> None of the other interface files are affected by or affect realtime
> processes.
I'm not sure the changed formulation make it clearer.
What was the unexpected value with !CONFIG_RT_GROUP_SCHED that made you
change this docs?
(Please note the docs is for generic cgroup, not only root cgroup.)
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-05 16:19 ` Michal Koutný
@ 2025-03-06 11:02 ` Shashank.Mahadasyam
2025-03-10 17:14 ` Michal Koutný
0 siblings, 1 reply; 13+ messages in thread
From: Shashank.Mahadasyam @ 2025-03-06 11:02 UTC (permalink / raw)
To: Michal Koutný
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya.Takumi,
Shashank.Mahadasyam
Hi Michal,
> Hello Shashank.
>
> On Wed, Mar 05, 2025 at 01:12:44PM +0900, Shashank Balaji via B4 Relay <devnull+shashank.mahadasyam.sony.com@kernel.org> wrote:
> > From: Shashank Balaji <shashank.mahadasyam@sony.com>
> >
> > If the cpu controller is enabled in a CONFIG_RT_GROUP_SCHED
> > disabled setting, cpu.stat and cpu.pressure account for realtime
> > processes, and cpu.uclamp.{min, max} affect realtime processes as well.
> > None of the other interface files are affected by or affect realtime
> > processes.
>
> I'm not sure the changed formulation make it clearer.
> What was the unexpected value with !CONFIG_RT_GROUP_SCHED that made you
> change this docs?
>
> (Please note the docs is for generic cgroup, not only root cgroup.)
The documentation covers what happens when CONFIG_RT_GROUP_SCHED is enabled,
i.e. all the realtime processes have to be in the root cgroup for the cpu
controller to be enabled. But what is not documented is how realtime processes
are treated with !CONFIG_RT_GROUP_SCHED. Initially I was under the impression
"oh, the other interface files seem to affect only processes under the fair
class scheduler, so maybe they don't affect realtime processes". But on further
digging, I found that cpu.stat and cpu.pressure account for realtime processes,
and cpu.uclamp.{min, max} affect realtime processes as well.
Do you think it should be rephrased to make it clearer?
Thanks,
Shashank
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-06 11:02 ` Shashank.Mahadasyam
@ 2025-03-10 17:14 ` Michal Koutný
2025-03-28 10:45 ` Shashank.Mahadasyam
0 siblings, 1 reply; 13+ messages in thread
From: Michal Koutný @ 2025-03-10 17:14 UTC (permalink / raw)
To: Shashank.Mahadasyam
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya.Takumi
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On Thu, Mar 06, 2025 at 11:02:22AM +0000, "Shashank.Mahadasyam@sony.com" <Shashank.Mahadasyam@sony.com> wrote:
> Do you think it should be rephrased to make it clearer?
Aha, I understand now why it confused you (with the paragraph about
realtime tasks right above interface files).
I'd consider such a minimal correction:
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1076,7 +1076,7 @@ cpufreq governor about the minimum desired frequency which should always be
provided by a CPU, as well as the maximum desired frequency, which should not
be exceeded by a CPU.
-WARNING: cgroup2 doesn't yet support control of realtime processes. For
+WARNING: cgroup2 doesn't yet support (bandwidth) control of realtime processes. For
a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group
scheduling of realtime processes, the cpu controller can only be enabled
when all RT processes are in the root cgroup. This limitation does
Of course wordier rewrite is possible but I find the text as you
originally proposed unclear due to several uses of "only" that imply
restrictions that aren't in place in reality.
Thanks,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-10 17:14 ` Michal Koutný
@ 2025-03-28 10:45 ` Shashank.Mahadasyam
2025-04-02 12:49 ` Michal Koutný
0 siblings, 1 reply; 13+ messages in thread
From: Shashank.Mahadasyam @ 2025-03-28 10:45 UTC (permalink / raw)
To: Michal Koutný
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya.Takumi,
Shashank.Mahadasyam
Hi Michal,
Apologies for the delay :)
> On Thu, Mar 06, 2025 at 11:02:22AM +0000, "Shashank.Mahadasyam@sony.com" <Shashank.Mahadasyam@sony.com> wrote:
> > Do you think it should be rephrased to make it clearer?
>
> Aha, I understand now why it confused you (with the paragraph about
> realtime tasks right above interface files).
>
> I'd consider such a minimal correction:
>
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1076,7 +1076,7 @@ cpufreq governor about the minimum desired frequency which should always be
> provided by a CPU, as well as the maximum desired frequency, which should not
> be exceeded by a CPU.
>
> -WARNING: cgroup2 doesn't yet support control of realtime processes. For
> +WARNING: cgroup2 doesn't yet support (bandwidth) control of realtime processes. For
> a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group
> scheduling of realtime processes, the cpu controller can only be enabled
> when all RT processes are in the root cgroup. This limitation does
I'll incorporate this in v2. Thanks!
> Of course wordier rewrite is possible but I find the text as you
> originally proposed unclear due to several uses of "only" that imply
> restrictions that aren't in place in reality.
Given the different scheduling classes (fair, ext, rt, deadline), it would be nice
to document which cpu interface files are related to which scheduling classes.
Like, cpu.idle applies to only the fair class, cpu.weight applies to the fair class,
as well as ext, if configured so, cpu.stat accounts for all classes
(I'm not sure about this, I haven't tested this yet), etc.
The proposed patch is in this direction, but just for the rt class. Any suggestions
on how this intent can be made clearer? How about something like this:
CPU Interface Files
~~~~~~~~~~~~~~~~~~~
All time durations are in microseconds. The scheduling classes mentioned beside
the interface files are the only classes they are related to.
cpu.stat (fair, ext, rt, deadline)
...
cpu.weight (fair, ext)
...
cpu.weight.nice (fair, ext)
...
cpu.max (fair)
...
cpu.max.burst (fair)
...
cpu.pressure (fair, ext, rt, deadline)
...
cpu.uclamp.min (fair, rt)
...
cpu.uclamp.max (fair, rt)
...
cpu.idle (fair)
Thanks,
Shashank
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller
2025-03-28 10:45 ` Shashank.Mahadasyam
@ 2025-04-02 12:49 ` Michal Koutný
0 siblings, 0 replies; 13+ messages in thread
From: Michal Koutný @ 2025-04-02 12:49 UTC (permalink / raw)
To: Shashank.Mahadasyam
Cc: Tejun Heo, Johannes Weiner, Jonathan Corbet, Waiman Long,
cgroups, linux-doc, linux-kernel, Shinya.Takumi
[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]
Hello.
On Fri, Mar 28, 2025 at 10:45:02AM +0000, "Shashank.Mahadasyam@sony.com" <Shashank.Mahadasyam@sony.com> wrote:
> Given the different scheduling classes (fair, ext, rt, deadline), it would be nice
> to document which cpu interface files are related to which scheduling classes.
> Like, cpu.idle applies to only the fair class, cpu.weight applies to the fair class,
> as well as ext, if configured so, cpu.stat accounts for all classes
> (I'm not sure about this, I haven't tested this yet), etc.
>
> The proposed patch is in this direction, but just for the rt class. Any suggestions
> on how this intent can be made clearer? How about something like this:
Classes are implementation terminology but userspace knows this under
scheduling policies (SCHED_NORMAL,..., SCHED_EXT). It might be better to
use that categories.
>
> CPU Interface Files
> ~~~~~~~~~~~~~~~~~~~
>
> All time durations are in microseconds. The scheduling classes mentioned beside
> the interface files are the only classes they are related to.
list of related <categories> is only indicative as implementation may change
(Even when talking about policies I think the relation still tends to be
an implementation detail, so I'd also add something like the above. But
I think it's good to have such an overview to know what is where
implemented.)
HTH,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-04-02 12:49 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-05 4:12 [PATCH 0/2] cgroup, docs: Clarify interaction of RT processes with cgroup v2 cpu controller Shashank Balaji via B4 Relay
2025-03-05 4:12 ` [PATCH 1/2] cgroup, docs: Be explicit about independence of RT_GROUP_SCHED and non-cpu controllers Shashank Balaji via B4 Relay
2025-03-05 14:13 ` Waiman Long
2025-03-05 16:15 ` Michal Koutný
2025-03-05 18:44 ` Tejun Heo
2025-03-05 4:12 ` [PATCH 2/2] cgroup, docs: Document interaction of RT processes with cpu controller Shashank Balaji via B4 Relay
2025-03-05 14:16 ` Waiman Long
2025-03-06 10:23 ` Shashank.Mahadasyam
2025-03-05 16:19 ` Michal Koutný
2025-03-06 11:02 ` Shashank.Mahadasyam
2025-03-10 17:14 ` Michal Koutný
2025-03-28 10:45 ` Shashank.Mahadasyam
2025-04-02 12:49 ` Michal Koutný
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®