From df5d8aafc46149be00e1091b082525343487fa29 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 5 May 2009 17:50:21 +0200 Subject: [PATCH] --- yaml --- r: 145710 b: refs/heads/master c: 60aa605dfce2976e54fa76e805ab0f221372d4d9 h: refs/heads/master v: v3 --- [refs] | 2 +- .../Documentation/scheduler/sched-rt-group.txt | 18 ++++++++++++++++++ trunk/kernel/sched.c | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 509e9992bf85..0030a60b6a8f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6e29ec5701e9d44fa02b96c1c5c45f7516182b65 +refs/heads/master: 60aa605dfce2976e54fa76e805ab0f221372d4d9 diff --git a/trunk/Documentation/scheduler/sched-rt-group.txt b/trunk/Documentation/scheduler/sched-rt-group.txt index 5ba4d3fc625a..eb74b014a3f8 100644 --- a/trunk/Documentation/scheduler/sched-rt-group.txt +++ b/trunk/Documentation/scheduler/sched-rt-group.txt @@ -4,6 +4,7 @@ CONTENTS ======== +0. WARNING 1. Overview 1.1 The problem 1.2 The solution @@ -14,6 +15,23 @@ CONTENTS 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 =========== diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 54d67b94f1a9..2a43a581ead3 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -9917,6 +9917,13 @@ static int sched_rt_global_constraints(void) if (sysctl_sched_rt_period <= 0) 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); for_each_possible_cpu(i) { struct rt_rq *rt_rq = &cpu_rq(i)->rt;