Skip to contentSkip to conversation

cgroup: Fix documentation for cpu.idle

PATCH Applied Josh Don 4 participants 5 messages Dec 1, 2023 – Dec 2, 2023

Subsystems (2)
lore
Share & tools
lore

Josh Don

author
#0 lore raw

PATCH 1/1 cgroup: Fix documentation for cpu.idle

Two problems:
- cpu.idle cgroups show up with 0 weight, correct the documentation to indicate this.
- cpu.idle has no entry describing it.

---
 Documentation/admin-guide/cgroup-v2.rst | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
Documentation/admin-guide/cgroup-v2.rst +15 -1
index 3f85254f3cef..9debf02bcb39 100644
@@ -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
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
#1 lore raw
Quoted 5 lines · Josh Don
Documentation/admin-guide/cgroup-v2.rst +0 -0
index 3f85254f3cef..9debf02bcb39 100644

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1100

Quoted 9 lines
Documentation/admin-guide/cgroup-v2.rst +5 -1
@@ -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.

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1168

Quoted 12 lines
Documentation/admin-guide/cgroup-v2.rst +5 -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.

"... cgroup analogy to ..."

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1174

Quoted 6 lines
Documentation/admin-guide/cgroup-v2.rst +5 -0
+	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.

Signature · 1 line
An old man doll... just what I always wanted! - Clara
maintainer
#2 lore raw
Quoted 11 lines · Bagas Sanjaya

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1168

Quoted 9 lines · Josh Don
Documentation/admin-guide/cgroup-v2.rst +5 -0
index 3f85254f3cef..9debf02bcb39 100644
+  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 ..."

Quoted 1 line

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1169

Quoted 1 line
Documentation/admin-guide/cgroup-v2.rst +1 -0
+	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

maintainer Applied
#4 lore raw
In reply to Josh Don
Quoted 6 lines · Josh Don

Two problems:
- cpu.idle cgroups show up with 0 weight, correct the documentation to indicate this.
- cpu.idle has no entry describing it.

Applied to cgroup/for-6.8.

Thanks.

Signature · 1 line
tejun
Reviewed-by
#3 lore raw
In reply to Jonathan Corbet
Quoted 13 lines · Jonathan Corbet
Quoted 11 lines · Bagas Sanjaya

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1168

Quoted 9 lines · Josh Don
Documentation/admin-guide/cgroup-v2.rst +5 -0
index 3f85254f3cef..9debf02bcb39 100644
+  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 ..."

Quoted 5 lines
Quoted 1 line

Documentation/admin-guide/cgroup-v2.rst All time durations are in microseconds. · line 1169

Quoted 1 line
Documentation/admin-guide/cgroup-v2.rst +1 -0
+	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,

Sorry for inconvenience.

Signature · 1 line
An old man doll... just what I always wanted! - Clara