Skip to contentSkip to conversation

sched/fair: Fix endless loop in idle_balance()

PATCH In review Kirill Tkhai 3 participants 3 messages Mar 6, 2014 – Mar 11, 2014 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Fix endless loop in idle_balance()

This patch must go on top of the series:

[tip 1/2] sched/fair: Push down check for high priority class task into idle_balance() [tip 2/2] sched/core: Fix endless loop in pick_next_task()

Check for fair tasks number to decide, that we've pulled a task. rq's nr_running may contain throttled RT tasks.

CC Peter Zijlstra <[email protected]>
CC Ingo Molnar <[email protected]>

Peter, this finaly fixes problem with RT throttling. Should I send all three patches as one series?

---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 10db4a8..f1eedae 100644
@@ -6710,7 +6710,7 @@ static int idle_balance(struct rq *this_rq)
 	 * While browsing the domains, we released the rq lock.
 	 * A task could have be enqueued in the meantime
 	 */
-	if (this_rq->nr_running && !pulled_task) {
+	if (this_rq->cfs.h_nr_running && !pulled_task) {
 		pulled_task = 1;
 		goto out;
 	}
maintainer
#1 lore raw
Quoted 2 lines · Kirill Tkhai

Peter, this finaly fixes problem with RT throttling. Should I send all three patches as one series?

No need; got them. Thanks!

#2 lore raw
In reply to Kirill Tkhai
sched/fair: Fix endless loop in idle_balance()
Commit-ID:  35805ff8f4fc535ac85330170d3c56829c87c677
Gitweb:     http://git.kernel.org/tip/35805ff8f4fc535ac85330170d3c56829c87c677
Author:     Kirill Tkhai <[email protected]>
AuthorDate: Thu, 6 Mar 2014 19:16:15 +0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 11 Mar 2014 12:05:41 +0100

sched/fair: Fix endless loop in idle_balance()

Check for fair tasks number to decide, that we've pulled a task. rq's nr_running may contain throttled RT tasks.

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
index 10db4a8..f1eedae 100644
@@ -6710,7 +6710,7 @@ static int idle_balance(struct rq *this_rq)
 	 * While browsing the domains, we released the rq lock.
 	 * A task could have be enqueued in the meantime
 	 */
-	if (this_rq->nr_running && !pulled_task) {
+	if (this_rq->cfs.h_nr_running && !pulled_task) {
 		pulled_task = 1;
 		goto out;
 	}