* [patch] sched: fix the all pinned logic in load_balance_newidle()
@ 2007-07-16 23:54 Siddha, Suresh B
2007-07-17 8:21 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Siddha, Suresh B @ 2007-07-16 23:54 UTC (permalink / raw)
To: mingo, nickpiggin; +Cc: linux-kernel, akpm, clameter
nr_moved is not the correct check for triggering all pinned logic. Fix the
all pinned logic in the case of load_balance_newidle().
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
diff --git a/kernel/sched.c b/kernel/sched.c
index 3332bbb..0cdac9c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2668,6 +2668,7 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
unsigned long imbalance;
int nr_moved = 0;
int sd_idle = 0;
+ int all_pinned = 0;
cpumask_t cpus = CPU_MASK_ALL;
/*
@@ -2706,10 +2707,10 @@ redo:
double_lock_balance(this_rq, busiest);
nr_moved = move_tasks(this_rq, this_cpu, busiest,
minus_1_or_zero(busiest->nr_running),
- imbalance, sd, CPU_NEWLY_IDLE, NULL);
+ imbalance, sd, CPU_NEWLY_IDLE, &all_pinned);
spin_unlock(&busiest->lock);
- if (!nr_moved) {
+ if (unlikely(all_pinned)) {
cpu_clear(cpu_of(busiest), cpus);
if (!cpus_empty(cpus))
goto redo;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [patch] sched: fix the all pinned logic in load_balance_newidle()
2007-07-16 23:54 [patch] sched: fix the all pinned logic in load_balance_newidle() Siddha, Suresh B
@ 2007-07-17 8:21 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2007-07-17 8:21 UTC (permalink / raw)
To: Siddha, Suresh B; +Cc: nickpiggin, linux-kernel, akpm, clameter
* Siddha, Suresh B <suresh.b.siddha@intel.com> wrote:
> nr_moved is not the correct check for triggering all pinned logic. Fix
> the all pinned logic in the case of load_balance_newidle().
indeeed.
i've applied your patch to my queue. (I've done a trivial style change
to it, see below.)
Ingo
--------------------->
Subject: sched: fix the all pinned logic in load_balance_newidle()
From: Suresh Siddha <suresh.b.siddha@intel.com>
nr_moved is not the correct check for triggering all pinned logic. Fix
the all pinned logic in the case of load_balance_newidle().
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -2679,6 +2679,7 @@ load_balance_newidle(int this_cpu, struc
unsigned long imbalance;
int nr_moved = 0;
int sd_idle = 0;
+ int all_pinned = 0;
cpumask_t cpus = CPU_MASK_ALL;
/*
@@ -2717,10 +2718,11 @@ redo:
double_lock_balance(this_rq, busiest);
nr_moved = move_tasks(this_rq, this_cpu, busiest,
minus_1_or_zero(busiest->nr_running),
- imbalance, sd, CPU_NEWLY_IDLE, NULL);
+ imbalance, sd, CPU_NEWLY_IDLE,
+ &all_pinned);
spin_unlock(&busiest->lock);
- if (!nr_moved) {
+ if (unlikely(all_pinned)) {
cpu_clear(cpu_of(busiest), cpus);
if (!cpus_empty(cpus))
goto redo;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-17 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16 23:54 [patch] sched: fix the all pinned logic in load_balance_newidle() Siddha, Suresh B
2007-07-17 8:21 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox