lkml.org 
[lkml]   [2005]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[sched, patch] better wake-balancing

another approach would be the patch below, to do wakeup-balancing only
if the wakeup CPU or the task CPU is idle.

I've measured half-loaded tbench and unless total wakeup-balancing
removal it does not degrade with this patch applied, while fully loaded
tbench and other workloads clearly improve.

Ken, could you give this one a try? (It's against the current scheduler
queue in -mm, but also applies fine to current Linus trees.)

Ingo

---
do wakeup-balancing only if the wakeup-CPU or the task-CPU is idle.

this prevents excessive wakeup-balancing while the system is highly
loaded, but helps spread out the workload on partly idle systems.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

kernel/sched.c | 6 ++++++
1 files changed, 6 insertions(+)
Index: linux-sched-curr/kernel/sched.c
===================================================================
--- linux-sched-curr.orig/kernel/sched.c
+++ linux-sched-curr/kernel/sched.c
@@ -1252,7 +1252,13 @@ static int try_to_wake_up(task_t *p, uns
if (unlikely(task_running(rq, p)))
goto out_activate;

+ /*
+ * If neither this CPU, nor the previous CPU the task was
+ * running on is idle then skip wakeup-balancing:
+ */
new_cpu = cpu;
+ if (!idle_cpu(this_cpu) && !idle_cpu(cpu))
+ goto out_set_cpu;

schedstat_inc(rq, ttwu_cnt);
if (cpu == this_cpu) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-07-29 16:18    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site