cgroup: Fix documentation for cpu.idle

Message ID 20231201005203.309873-1-joshdon@google.com
State New
Headers
Series cgroup: Fix documentation for cpu.idle |

Commit Message

Josh Don Dec. 1, 2023, 12:52 a.m. UTC
  Two problems:
	- cpu.idle cgroups show up with 0 weight, correct the
	  documentation to indicate this.
	- cpu.idle has no entry describing it.

Signed-off-by: Josh Don <joshdon@google.com>
---
 Documentation/admin-guide/cgroup-v2.rst | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
  

Comments

Bagas Sanjaya Dec. 1, 2023, 5:48 a.m. UTC | #1
On Thu, Nov 30, 2023 at 04:52:03PM -0800, Josh Don wrote:
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index 3f85254f3cef..9debf02bcb39 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1093,7 +1093,11 @@ All time durations are in microseconds.
>  	A read-write single value file which exists on non-root
>  	cgroups.  The default is "100".
>  
> -	The weight in the range [1, 10000].
> +	For non idle groups (cpu.idle = 0), the weight is in the
> +	range [1, 10000].
> +
> +	If the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1),
> +	then the weight will show as a 0.

This one LGTM.

>  
>    cpu.weight.nice
>  	A read-write single value file which exists on non-root
> @@ -1157,6 +1161,16 @@ All time durations are in microseconds.
>          values similar to the sched_setattr(2). This maximum utilization
>          value is used to clamp the task specific maximum utilization clamp.
>  
> +  cpu.idle
> +	A read-write single value file which exists on non-root cgroups.
> +	The default is 0.
> +
> +	This is the cgroup analog of the per-task SCHED_IDLE sched policy.
"... cgroup analogy to ..."
> +	Setting this value to a 1 will make the scheduling policy of the
> +	cgroup SCHED_IDLE. The threads inside the cgroup will retain their
> +	own relative priorities, but the cgroup itself will be treated as
> +	very low priority relative to its peers.
> +
>  

Thanks.
  
Jonathan Corbet Dec. 1, 2023, 3:14 p.m. UTC | #2
Bagas Sanjaya <bagasdotme@gmail.com> writes:

> On Thu, Nov 30, 2023 at 04:52:03PM -0800, Josh Don wrote:
>> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
>> index 3f85254f3cef..9debf02bcb39 100644
>> --- a/Documentation/admin-guide/cgroup-v2.rst
>> +++ b/Documentation/admin-guide/cgroup-v2.rst
>> +  cpu.idle
>> +	A read-write single value file which exists on non-root cgroups.
>> +	The default is 0.
>> +
>> +	This is the cgroup analog of the per-task SCHED_IDLE sched policy.
> "... cgroup analogy to ..."
>> +	Setting this value to a 1 will make the scheduling policy of the

Bagas, please stop this (again).  The original wording is better than
your suggested "improvement".

jon
  
Tejun Heo Dec. 1, 2023, 4:49 p.m. UTC | #3
On Thu, Nov 30, 2023 at 04:52:03PM -0800, Josh Don wrote:
> Two problems:
> 	- cpu.idle cgroups show up with 0 weight, correct the
> 	  documentation to indicate this.
> 	- cpu.idle has no entry describing it.
> 
> Signed-off-by: Josh Don <joshdon@google.com>

Applied to cgroup/for-6.8.

Thanks.
  
Bagas Sanjaya Dec. 2, 2023, 1:25 a.m. UTC | #4
On 12/1/23 22:14, Jonathan Corbet wrote:
> Bagas Sanjaya <bagasdotme@gmail.com> writes:
> 
>> On Thu, Nov 30, 2023 at 04:52:03PM -0800, Josh Don wrote:
>>> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
>>> index 3f85254f3cef..9debf02bcb39 100644
>>> --- a/Documentation/admin-guide/cgroup-v2.rst
>>> +++ b/Documentation/admin-guide/cgroup-v2.rst
>>> +  cpu.idle
>>> +	A read-write single value file which exists on non-root cgroups.
>>> +	The default is 0.
>>> +
>>> +	This is the cgroup analog of the per-task SCHED_IDLE sched policy.
>> "... cgroup analogy to ..."
>>> +	Setting this value to a 1 will make the scheduling policy of the
> 
> Bagas, please stop this (again).  The original wording is better than
> your suggested "improvement".
> 

OK, withdrawn!

And then,

Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>

Sorry for inconvenience.
  

Patch

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 3f85254f3cef..9debf02bcb39 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1093,7 +1093,11 @@  All time durations are in microseconds.
 	A read-write single value file which exists on non-root
 	cgroups.  The default is "100".
 
-	The weight in the range [1, 10000].
+	For non idle groups (cpu.idle = 0), the weight is in the
+	range [1, 10000].
+
+	If the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1),
+	then the weight will show as a 0.
 
   cpu.weight.nice
 	A read-write single value file which exists on non-root
@@ -1157,6 +1161,16 @@  All time durations are in microseconds.
         values similar to the sched_setattr(2). This maximum utilization
         value is used to clamp the task specific maximum utilization clamp.
 
+  cpu.idle
+	A read-write single value file which exists on non-root cgroups.
+	The default is 0.
+
+	This is the cgroup analog of the per-task SCHED_IDLE sched policy.
+	Setting this value to a 1 will make the scheduling policy of the
+	cgroup SCHED_IDLE. The threads inside the cgroup will retain their
+	own relative priorities, but the cgroup itself will be treated as
+	very low priority relative to its peers.
+
 
 
 Memory