Skip to contentSkip to conversation

sched/rt: disable RT_RUNTIME_SHARE by default and document it

PATCH Superseded Daniel Bristot de Oliveira 3 participants 6 messages Nov 15, 2016 Scheduler

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover sched/rt: disable RT_RUNTIME_SHARE by default and document it

Disable RT_RUNTIME_SHARE by default and document it.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Clark Williams <[email protected]>
Cc Luis Claudio R. Goncalves <[email protected]>

Daniel Bristot de Oliveira (2):
sched/rt: Disable RT_RUNTIME_SHARE by default sched/rt: Document RT_RUNTIME_SHARE sched feature

 kernel/sched/features.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 sched/rt: Disable RT_RUNTIME_SHARE by default

The RT_RUNTIME_SHARE sched feature enables the sharing of rt_runtime between CPUs, allowing a CPU to run a real-time task up to 100% of the time while leaving more space for non-real-time tasks to run on the CPU that lend rt_runtime.

The problem is that a CPU can easily borrow enough rt_runtime to allow a spinning rt-task to run forever, starving per-cpu tasks like kworkers, which are non-real-time by design.

This patch disables RT_RUNTIME_SHARE by default, avoiding this problem. The feature will still be present for users that want to enable it, though.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Clark Williams <[email protected]>
Cc Luis Claudio R. Goncalves <[email protected]>
kernel/sched/features.h +1 -1
index 69631fa..5fffebfe 100644
@@ -65,7 +65,7 @@ SCHED_FEAT(RT_PUSH_IPI, true)
 #endif
 
 SCHED_FEAT(FORCE_SD_OVERLAP, false)
-SCHED_FEAT(RT_RUNTIME_SHARE, true)
+SCHED_FEAT(RT_RUNTIME_SHARE, false)
 SCHED_FEAT(LB_MIN, false)
 SCHED_FEAT(ATTACH_AGE_LOAD, true)
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 sched/rt: Document RT_RUNTIME_SHARE sched feature

In reply to Daniel Bristot de Oliveira

Add a comment explaining the RT_RUNTIME_SHARE sched feature.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Clark Williams <[email protected]>
Cc Luis Claudio R. Goncalves <[email protected]>
kernel/sched/features.h +10 -0
index 5fffebfe..531c4bb 100644
@@ -65,7 +65,17 @@ SCHED_FEAT(RT_PUSH_IPI, true)
 #endif
 
 SCHED_FEAT(FORCE_SD_OVERLAP, false)
+
+/*
+ * Enables the sharing of rt_runtime between CPUs, allowing a CPU to
+ * run a real-time task up to 100% of the time while leaving more
+ * space for non-real-time tasks to run on the CPU that lend rt_runtime.
+ *
+ * WARNING: This may allow the starvation of non-real-time tasks pinned
+ * to the CPU in which a spinning rt-task runs forever.
+ */
 SCHED_FEAT(RT_RUNTIME_SHARE, false)
+
 SCHED_FEAT(LB_MIN, false)
 SCHED_FEAT(ATTACH_AGE_LOAD, true)
 
Signature · 1 line
2.7.4
Acked-by on the v1 series
#3 lore raw
In reply to Daniel Bristot de Oliveira
Quoted 9 lines · Daniel Bristot de Oliveira

Disable RT_RUNTIME_SHARE by default and document it.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Clark Williams <[email protected]>
Cc Luis Claudio R. Goncalves <[email protected]>
Quoted 6 lines

Daniel Bristot de Oliveira (2):
sched/rt: Disable RT_RUNTIME_SHARE by default sched/rt: Document RT_RUNTIME_SHARE sched feature

 kernel/sched/features.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

In light of the discussion about "sched/rt: RT_RUNTIME_GREED sched feature", disabling RT_RUNTIME_SHARE by default restores a portion of determinism we gave away by using the clever mechanism behind RT_RUNTIME_SHARE. (I should have prefaced that with a IMHO).

Luis

reviewer Acked-by on the v1 series
#4 lore raw
In reply to Daniel Bristot de Oliveira
Quoted 9 lines · On Tue, 15 Nov 2016 11:39:09 +0100 Daniel Bristot de Oliveira…

Disable RT_RUNTIME_SHARE by default and document it.

Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Clark Williams <[email protected]>
Cc Luis Claudio R. Goncalves <[email protected]>
Quoted 7 lines

Daniel Bristot de Oliveira (2):
sched/rt: Disable RT_RUNTIME_SHARE by default sched/rt: Document RT_RUNTIME_SHARE sched feature

 kernel/sched/features.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

I don't see why this is two patches. A change and a comment can go together, and probably should, especially since the comment explains the change as well.

With a folded patch...

-- Steve

#5 lore raw
Quoted 5 lines · Steven Rostedt

I don't see why this is two patches. A change and a comment can go together, and probably should, especially since the comment explains the change as well.

With a folded patch...

I will cook a v2 in a single patch!

Thanks!

-- Daniel