* [PATCH] sched: rt: document the risk of small values in the bandwidth settings
@ 2009-05-04 15:07 Peter Zijlstra
2009-05-04 15:34 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2009-05-04 15:07 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, linux-kernel
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.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
---
Documentation/scheduler/sched-rt-group.txt | 18 ++++++++++++++++++
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 5ba4d3f..cfd51c0 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/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 unusable system, the knobs are
+root only and assume root knows what he's on about.
+
+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/kernel/sched.c b/kernel/sched.c
index 11f6da4..c5ef114 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -10021,6 +10021,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;
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] sched: rt: document the risk of small values in the bandwidth settings
2009-05-04 15:07 [PATCH] sched: rt: document the risk of small values in the bandwidth settings Peter Zijlstra
@ 2009-05-04 15:34 ` Randy Dunlap
2009-05-04 15:36 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2009-05-04 15:34 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel
Peter Zijlstra wrote:
> 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.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> Documentation/scheduler/sched-rt-group.txt | 18 ++++++++++++++++++
> 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 5ba4d3f..cfd51c0 100644
> --- a/Documentation/scheduler/sched-rt-group.txt
> +++ b/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 unusable system, the knobs are
> +root only and assume root knows what he's on about.
I know that my English is limited, but I don't know what this means:
"what he's on about."
> +
> +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/kernel/sched.c b/kernel/sched.c
> index 11f6da4..c5ef114 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -10021,6 +10021,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;
>
> --
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sched: rt: document the risk of small values in the bandwidth settings
2009-05-04 15:34 ` Randy Dunlap
@ 2009-05-04 15:36 ` Peter Zijlstra
2009-05-04 15:39 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2009-05-04 15:36 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel
On Mon, 2009-05-04 at 08:34 -0700, Randy Dunlap wrote:
> > +Fiddling with these settings can result in an unusable system, the knobs are
> > +root only and assume root knows what he's on about.
>
> I know that my English is limited, but I don't know what this means:
> "what he's on about."
Hehe, OK, how about we write it like:
Fiddling with these settings can result in an unstable system, the knobs are
root only and assumes root knows what he is doing.
Does that work better for you?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sched: rt: document the risk of small values in the bandwidth settings
2009-05-04 15:36 ` Peter Zijlstra
@ 2009-05-04 15:39 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2009-05-04 15:39 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Randy Dunlap, Ingo Molnar, Thomas Gleixner, linux-kernel
Peter Zijlstra wrote:
> On Mon, 2009-05-04 at 08:34 -0700, Randy Dunlap wrote:
>>> +Fiddling with these settings can result in an unusable system, the knobs are
>>> +root only and assume root knows what he's on about.
>> I know that my English is limited, but I don't know what this means:
>> "what he's on about."
>
> Hehe, OK, how about we write it like:
>
> Fiddling with these settings can result in an unstable system, the knobs are
> root only and assumes root knows what he is doing.
>
> Does that work better for you?
Yes, thanks.
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-04 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 15:07 [PATCH] sched: rt: document the risk of small values in the bandwidth settings Peter Zijlstra
2009-05-04 15:34 ` Randy Dunlap
2009-05-04 15:36 ` Peter Zijlstra
2009-05-04 15:39 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox