summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-10-15 17:00:19 +0200
committerIngo Molnar <mingo@elte.hu>2007-10-15 17:00:19 +0200
commit71e20f1873d46e138c26ce83f8fe54b7221f572f (patch)
tree3b5c5083d3ffcf7c9d7ddad81acf30c09197ef99 /kernel/sched.c
parentd172fcd3ae1ca7ac27ec8904242fd61e0e11d332 (diff)
downloadblackbird-op-linux-71e20f1873d46e138c26ce83f8fe54b7221f572f.tar.gz
blackbird-op-linux-71e20f1873d46e138c26ce83f8fe54b7221f572f.zip
sched: affine sync wakeups
make sync wakeups affine for cache-cold tasks: if a cache-cold task is woken up by a sync wakeup then use the opportunity to migrate it straight away. (the two tasks are 'related' because they communicate) Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5a91fe0b5de6..7fd343462597 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1521,6 +1521,12 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
unsigned long tl = this_load;
unsigned long tl_per_task;
+ /*
+ * Attract cache-cold tasks on sync wakeups:
+ */
+ if (sync && !task_hot(p, rq->clock, this_sd))
+ goto out_set_cpu;
+
schedstat_inc(p, se.nr_wakeups_affine_attempts);
tl_per_task = cpu_avg_load_per_task(this_cpu);
@@ -1598,7 +1604,7 @@ out_activate:
* the waker guarantees that the freshly woken up task is going
* to be considered on this CPU.)
*/
- if (!sync || cpu != this_cpu)
+ if (!sync || rq->curr == rq->idle)
check_preempt_curr(rq, p);
success = 1;
OpenPOWER on IntegriCloud