From: Nikhil Rao <ncrao@google.com>
To: Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Mike Galbraith <efault@gmx.de>,
linux-kernel@vger.kernel.org
Cc: Venkatesh Pallipadi <venki@google.com>,
Ken Chen <kenchen@google.com>, Paul Turner <pjt@google.com>,
Nikhil Rao <ncrao@google.com>
Subject: [PATCH 4/6] sched: add sched_idle_balance argument to lb functions
Date: Thu, 29 Jul 2010 22:19:04 -0700 [thread overview]
Message-ID: <1280467146-32218-5-git-send-email-ncrao@google.com> (raw)
In-Reply-To: <1280467146-32218-1-git-send-email-ncrao@google.com>
This patch adds an extra sched_idle_balance argument to move_tasks,
load_balance_fair and balance_tasks. This argument is required to differentiate
between SCHED_NORMAL/SCHED_BATCH load balancing and SCHED_IDLE balancing.
Signed-off-by: Nikhil Rao <ncrao@google.com>
---
kernel/sched_fair.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 0e25e51..cb270e8 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1861,7 +1861,8 @@ static unsigned long
balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
unsigned long max_load_move, struct sched_domain *sd,
enum cpu_idle_type idle, int *all_pinned,
- int *this_best_prio, struct cfs_rq *busiest_cfs_rq)
+ int *this_best_prio, struct cfs_rq *busiest_cfs_rq,
+ int sched_idle_balance)
{
int loops = 0, pulled = 0, pinned = 0;
long rem_load_move = max_load_move;
@@ -1923,7 +1924,7 @@ static unsigned long
load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
unsigned long max_load_move,
struct sched_domain *sd, enum cpu_idle_type idle,
- int *all_pinned, int *this_best_prio)
+ int *all_pinned, int *this_best_prio, int sched_idle_balance)
{
long rem_load_move = max_load_move;
int busiest_cpu = cpu_of(busiest);
@@ -1949,7 +1950,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
moved_load = balance_tasks(this_rq, this_cpu, busiest,
rem_load, sd, idle, all_pinned, this_best_prio,
- busiest_cfs_rq);
+ busiest_cfs_rq, sched_idle_balance);
if (!moved_load)
continue;
@@ -1970,11 +1971,11 @@ static unsigned long
load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
unsigned long max_load_move,
struct sched_domain *sd, enum cpu_idle_type idle,
- int *all_pinned, int *this_best_prio)
+ int *all_pinned, int *this_best_prio, int sched_idle_balance)
{
return balance_tasks(this_rq, this_cpu, busiest,
max_load_move, sd, idle, all_pinned,
- this_best_prio, &busiest->cfs);
+ this_best_prio, &busiest->cfs, sched_idle_balance);
}
#endif
@@ -1988,7 +1989,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
unsigned long max_load_move,
struct sched_domain *sd, enum cpu_idle_type idle,
- int *all_pinned)
+ int *all_pinned, int sched_idle_balance)
{
unsigned long total_load_moved = 0, load_moved;
int this_best_prio = this_rq->curr->prio;
@@ -1996,7 +1997,8 @@ static int move_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
do {
load_moved = load_balance_fair(this_rq, this_cpu, busiest,
max_load_move - total_load_moved,
- sd, idle, all_pinned, &this_best_prio);
+ sd, idle, all_pinned, &this_best_prio,
+ sched_idle_balance);
total_load_moved += load_moved;
@@ -2878,7 +2880,7 @@ redo:
local_irq_save(flags);
double_rq_lock(this_rq, busiest);
ld_moved = move_tasks(this_rq, this_cpu, busiest,
- imbalance, sd, idle, &all_pinned);
+ imbalance, sd, idle, &all_pinned, 0);
double_rq_unlock(this_rq, busiest);
local_irq_restore(flags);
--
1.7.1
next prev parent reply other threads:[~2010-07-30 5:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-30 5:19 [PATCH 0/6] [RFC] Large weight differential leads to inefficient load balancing Nikhil Rao
2010-07-30 5:19 ` [PATCH 1/6] sched: account SCHED_IDLE tasks on rq->idle_nr_running Nikhil Rao
2010-07-30 5:19 ` [PATCH 2/6] sched: add SD_IDLE_LOAD_BALANCE to sched domain flags Nikhil Rao
2010-07-30 5:19 ` [PATCH 3/6] sched: add moving average of time spent servicing SCHED_NORMAL tasks Nikhil Rao
2010-07-30 5:19 ` Nikhil Rao [this message]
2010-07-30 5:19 ` [PATCH 5/6] sched: add SCHED_IDLE load balancer Nikhil Rao
2010-07-30 5:19 ` [PATCH 6/6] sched: enable SD_IDLE_LOAD_BALANCE on MC, CPU and NUMA (x86) domains Nikhil Rao
2010-07-30 13:32 ` [PATCH 0/6] [RFC] Large weight differential leads to inefficient load balancing Mike Galbraith
2010-07-30 18:59 ` Nikhil Rao
2010-07-30 19:03 ` Paul Turner
2010-08-02 11:39 ` Peter Zijlstra
2010-08-03 21:28 ` Nikhil Rao
2010-08-04 10:18 ` Peter Zijlstra
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=1280467146-32218-5-git-send-email-ncrao@google.com \
--to=ncrao@google.com \
--cc=efault@gmx.de \
--cc=kenchen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=venki@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
all inboxes | Powered by JetHome®