diff options
-rw-r--r-- | Documentation/scheduler/sched-rt-group.txt | 18 | ||||
-rw-r--r-- | kernel/sched.c | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt index 5ba4d3fc625a..eb74b014a3f8 100644 --- a/Documentation/scheduler/sched-rt-group.txt +++ b/Documentation/scheduler/sched-rt-group.txt | |||
@@ -4,6 +4,7 @@ | |||
4 | CONTENTS | 4 | CONTENTS |
5 | ======== | 5 | ======== |
6 | 6 | ||
7 | 0. WARNING | ||
7 | 1. Overview | 8 | 1. Overview |
8 | 1.1 The problem | 9 | 1.1 The problem |
9 | 1.2 The solution | 10 | 1.2 The solution |
@@ -14,6 +15,23 @@ CONTENTS | |||
14 | 3. Future plans | 15 | 3. Future plans |
15 | 16 | ||
16 | 17 | ||
18 | 0. WARNING | ||
19 | ========== | ||
20 | |||
21 | Fiddling with these settings can result in an unstable system, the knobs are | ||
22 | root only and assumes root knows what he is doing. | ||
23 | |||
24 | Most notable: | ||
25 | |||
26 | * very small values in sched_rt_period_us can result in an unstable | ||
27 | system when the period is smaller than either the available hrtimer | ||
28 | resolution, or the time it takes to handle the budget refresh itself. | ||
29 | |||
30 | * very small values in sched_rt_runtime_us can result in an unstable | ||
31 | system when the runtime is so small the system has difficulty making | ||
32 | forward progress (NOTE: the migration thread and kstopmachine both | ||
33 | are real-time processes). | ||
34 | |||
17 | 1. Overview | 35 | 1. Overview |
18 | =========== | 36 | =========== |
19 | 37 | ||
diff --git a/kernel/sched.c b/kernel/sched.c index 54d67b94f1a9..2a43a581ead3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -9917,6 +9917,13 @@ static int sched_rt_global_constraints(void) | |||
9917 | if (sysctl_sched_rt_period <= 0) | 9917 | if (sysctl_sched_rt_period <= 0) |
9918 | return -EINVAL; | 9918 | return -EINVAL; |
9919 | 9919 | ||
9920 | /* | ||
9921 | * There's always some RT tasks in the root group | ||
9922 | * -- migration, kstopmachine etc.. | ||
9923 | */ | ||
9924 | if (sysctl_sched_rt_runtime == 0) | ||
9925 | return -EBUSY; | ||
9926 | |||
9920 | spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags); | 9927 | spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags); |
9921 | for_each_possible_cpu(i) { | 9928 | for_each_possible_cpu(i) { |
9922 | struct rt_rq *rt_rq = &cpu_rq(i)->rt; | 9929 | struct rt_rq *rt_rq = &cpu_rq(i)->rt; |