Commit 60aa605d authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched: rt: document the risk of small values in the bandwidth settings

Thomas noted that we should disallow sysctl_sched_rt_runtime == 0 for
(!RT_GROUP) since the root group always has some RT tasks in it.

Further, update the documentation to inspire clue.

[ Impact: exclude corner-case sysctl_sched_rt_runtime value ]
Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090505155436.863098054@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6e29ec57
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
CONTENTS CONTENTS
======== ========
0. WARNING
1. Overview 1. Overview
1.1 The problem 1.1 The problem
1.2 The solution 1.2 The solution
...@@ -14,6 +15,23 @@ CONTENTS ...@@ -14,6 +15,23 @@ CONTENTS
3. Future plans 3. Future plans
0. WARNING
==========
Fiddling with these settings can result in an unstable system, the knobs are
root only and assumes root knows what he is doing.
Most notable:
* very small values in sched_rt_period_us can result in an unstable
system when the period is smaller than either the available hrtimer
resolution, or the time it takes to handle the budget refresh itself.
* very small values in sched_rt_runtime_us can result in an unstable
system when the runtime is so small the system has difficulty making
forward progress (NOTE: the migration thread and kstopmachine both
are real-time processes).
1. Overview 1. Overview
=========== ===========
......
...@@ -9917,6 +9917,13 @@ static int sched_rt_global_constraints(void) ...@@ -9917,6 +9917,13 @@ static int sched_rt_global_constraints(void)
if (sysctl_sched_rt_period <= 0) if (sysctl_sched_rt_period <= 0)
return -EINVAL; return -EINVAL;
/*
* There's always some RT tasks in the root group
* -- migration, kstopmachine etc..
*/
if (sysctl_sched_rt_runtime == 0)
return -EBUSY;
spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags); spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags);
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
struct rt_rq *rt_rq = &cpu_rq(i)->rt; struct rt_rq *rt_rq = &cpu_rq(i)->rt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment