mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patchlet] sched: fix rt throttle runtime borrowing
@ 2011-03-07  8:21 Mike Galbraith
  2011-03-07  9:11 ` Yong Zhang
  0 siblings, 1 reply; 12+ messages in thread
From: Mike Galbraith @ 2011-03-07  8:21 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar

Greetings,

The RT throttle leaves a bit to be desired as a protection mechanism.
With default settings, the thing won't save your bacon if you start a
single hog as RT on SMP box, or if your normally sane app goes nuts.

With the below, my box will limp along so I can kill the RT hog.  May
not be the best solution, but works for me.. modulo bustage I haven't
noticed yet of course.

sched: fix rt throttle runtime borrowing

If allowed to borrow up to rt_period, the throttle has no effect on an out
of control RT task, allowing it to consume 100% CPU indefinitely, blocking
system critical SCHED_NORMAL threads indefinitely.

Signed-off-by: Mike Galbraith <efault@gmx.de>

---
 kernel/sched_rt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/kernel/sched_rt.c
===================================================================
--- linux-2.6.orig/kernel/sched_rt.c
+++ linux-2.6/kernel/sched_rt.c
@@ -354,7 +354,7 @@ static int do_balance_runtime(struct rt_
 	weight = cpumask_weight(rd->span);
 
 	raw_spin_lock(&rt_b->rt_runtime_lock);
-	rt_period = ktime_to_ns(rt_b->rt_period);
+	rt_period = ktime_to_ns(rt_b->rt_period) - 1;
 	for_each_cpu(i, rd->span) {
 		struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i);
 		s64 diff;



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-03-08 14:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07  8:21 [patchlet] sched: fix rt throttle runtime borrowing Mike Galbraith
2011-03-07  9:11 ` Yong Zhang
2011-03-07  9:33   ` Mike Galbraith
2011-03-07 14:27     ` Mike Galbraith
2011-03-08  8:23       ` Yong Zhang
2011-03-08  8:26         ` Mike Galbraith
2011-03-08 12:46       ` Peter Zijlstra
2011-03-08 13:27         ` Mike Galbraith
2011-03-08 13:46           ` Peter Zijlstra
2011-03-08 14:25             ` Mike Galbraith
2011-03-08  8:19     ` Yong Zhang
2011-03-08  8:28       ` Mike Galbraith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®