Skip to contentSkip to conversation

sched: fix rt-bandwidth hotplug race

PATCH Applied Peter Zijlstra 2 participants 2 messages Aug 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix rt-bandwidth hotplug race

Subject: sched: fix rt-bandwidth hotplug race
From: Peter Zijlstra <[email protected]>
Date: Thu Aug 14 15:42:44 CEST 2008

When we hot-unplug a cpu and rebuild the sched-domain, all cpus will be detatched. Alex observed the case where a runqueue was stealing bandwidth from an already disabled runqueue to satisfy its own needs.

Stop this by skipping over already disabled runqueues.

---
 kernel/sched_rt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched_rt.c +1 -1
Index: linux-2.6/kernel/sched_rt.c
===================================================================
@@ -298,7 +298,7 @@ static void __disable_runtime(struct rq 
 			struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i);
 			s64 diff;
 
-			if (iter == rt_rq)
+			if (iter == rt_rq || iter->rt_runtime == RUNTIME_INF)
 				continue;
 
 			spin_lock(&iter->rt_runtime_lock);
Applied
#1 lore raw
Quoted 8 lines · Peter Zijlstra

Subject: sched: fix rt-bandwidth hotplug race
From: Peter Zijlstra <[email protected]>
Date: Thu Aug 14 15:42:44 CEST 2008

When we hot-unplug a cpu and rebuild the sched-domain, all cpus will be detatched. Alex observed the case where a runqueue was stealing bandwidth from an already disabled runqueue to satisfy its own needs.

Quoted 5 lines

Stop this by skipping over already disabled runqueues.

applied to tip/sched/urgent - thanks!

Ingo