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 1/8] sched: change load balance number to h_nr_running of run queue
Date: Sun, 18 Aug 2013 16:25:15 +0800 [thread overview]
Message-ID: <1376814322-7320-2-git-send-email-leiwen@marvell.com> (raw)
In-Reply-To: <1376814322-7320-1-git-send-email-leiwen@marvell.com>
Since rq->nr_running would include both migration and rt task, it is not
reasonable to seek to move nr_running number of task in the load_balance
function, since it only apply to cfs type.
Change it to cfs's h_nr_running, which could well present the task
number in current cfs queue.
Signed-off-by: Lei Wen <leiwen@marvell.com>
---
kernel/sched/fair.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f918635..d6153c8 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5096,17 +5096,19 @@ redo:
schedstat_add(sd, lb_imbalance[idle], env.imbalance);
ld_moved = 0;
- if (busiest->nr_running > 1) {
+ /* load balance only apply to CFS task, we use h_nr_running here */
+ if (busiest->cfs.h_nr_running > 1) {
/*
* Attempt to move tasks. If find_busiest_group has found
- * an imbalance but busiest->nr_running <= 1, the group is
+ * an imbalance but busiest->cfs.h_nr_running <= 1, the group is
* still unbalanced. ld_moved simply stays zero, so it is
* correctly treated as an imbalance.
*/
env.flags |= LBF_ALL_PINNED;
env.src_cpu = busiest->cpu;
env.src_rq = busiest;
- env.loop_max = min(sysctl_sched_nr_migrate, busiest->nr_running);
+ env.loop_max = min(sysctl_sched_nr_migrate,
+ busiest->cfs.h_nr_running);
update_h_load(env.src_cpu);
more_balance:
--
1.7.5.4
next prev parent reply other threads:[~2013-08-18 8:26 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 ` Lei Wen [this message]
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 ` [PATCH 7/8] sched: change active_load_balance_cpu_stop to use h_nr_running Lei Wen
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-2-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).