linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lei Wen <leiwen@marvell.com>
To: Paul Turner <pjt@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>, <mingo@redhat.com>,
	<leiwen@marvell.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 7/8] sched: change active_load_balance_cpu_stop to use h_nr_running
Date: Sun, 18 Aug 2013 16:25:21 +0800	[thread overview]
Message-ID: <1376814322-7320-8-git-send-email-leiwen@marvell.com> (raw)
In-Reply-To: <1376814322-7320-1-git-send-email-leiwen@marvell.com>

We should only avoid do the active load balance when there is no
cfs type task. If just use rq->nr_running, it is possible for the
source cpu has multiple rt task, while zero cfs task, so that it
would confuse the active load balance function that try to move,
but find no task it could move.

Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 kernel/sched/fair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3656603..4c96124 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5349,7 +5349,7 @@ static int active_load_balance_cpu_stop(void *data)
 		goto out_unlock;
 
 	/* Is there any task to move? */
-	if (busiest_rq->nr_running <= 1)
+	if (busiest_rq->cfs.h_nr_running == 0)
 		goto out_unlock;
 
 	/*
-- 
1.7.5.4


  parent reply	other threads:[~2013-08-18  8:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  8:25 [PATCH 0/8] sched: fixes for the nr_running usage Lei Wen
2013-08-18  8:25 ` [PATCH 1/8] sched: change load balance number to h_nr_running of run queue Lei Wen
2013-08-18  8:25 ` [PATCH 2/8] sched: change cpu_avg_load_per_task using h_nr_running Lei Wen
2013-08-18  8:25 ` [PATCH 3/8] sched: change update_rq_runnable_avg " Lei Wen
2013-08-18  8:25 ` [PATCH 4/8] sched: change pick_next_task_fair to h_nr_running Lei Wen
2013-08-18  8:25 ` [PATCH 5/8] sched: change update_sg_lb_stats " Lei Wen
2013-08-18  8:25 ` [PATCH 6/8] sched: change find_busiest_queue " Lei Wen
2013-08-18  8:25 ` Lei Wen [this message]
2013-08-18  8:25 ` [PATCH 8/8] sched: document the difference between nr_running and h_nr_running Lei Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376814322-7320-8-git-send-email-leiwen@marvell.com \
    --to=leiwen@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).