diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-03-18 20:42:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-03-18 23:27:53 -0400 |
commit | 4ae7d5cefd4aa3560e359a3b0f03e12adc8b5c86 (patch) | |
tree | c7517529ec199d3d9936b4049880a820534d2703 /kernel/sched.c | |
parent | 6f3d09291b4982991680b61763b2541e53e2a95f (diff) |
sched: improve affine wakeups
improve affine wakeups. Maintain the 'overlap' metric based on CFS's
sum_exec_runtime - which means the amount of time a task executes
after it wakes up some other task.
Use the 'overlap' for the wakeup decisions: if the 'overlap' is short,
it means there's strong workload coupling between this task and the
woken up task. If the 'overlap' is large then the workload is decoupled
and the scheduler will move them to separate CPUs more easily.
( Also slightly move the preempt_check within try_to_wake_up() - this has
no effect on functionality but allows 'early wakeups' (for still-on-rq
tasks) to be correctly accounted as well.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index d1ad69b270ca..adbd475cfd25 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1855,10 +1855,11 @@ out_activate: | |||
1855 | schedstat_inc(p, se.nr_wakeups_remote); | 1855 | schedstat_inc(p, se.nr_wakeups_remote); |
1856 | update_rq_clock(rq); | 1856 | update_rq_clock(rq); |
1857 | activate_task(rq, p, 1); | 1857 | activate_task(rq, p, 1); |
1858 | check_preempt_curr(rq, p); | ||
1859 | success = 1; | 1858 | success = 1; |
1860 | 1859 | ||
1861 | out_running: | 1860 | out_running: |
1861 | check_preempt_curr(rq, p); | ||
1862 | |||
1862 | p->state = TASK_RUNNING; | 1863 | p->state = TASK_RUNNING; |
1863 | #ifdef CONFIG_SMP | 1864 | #ifdef CONFIG_SMP |
1864 | if (p->sched_class->task_wake_up) | 1865 | if (p->sched_class->task_wake_up) |
@@ -1892,6 +1893,8 @@ static void __sched_fork(struct task_struct *p) | |||
1892 | p->se.exec_start = 0; | 1893 | p->se.exec_start = 0; |
1893 | p->se.sum_exec_runtime = 0; | 1894 | p->se.sum_exec_runtime = 0; |
1894 | p->se.prev_sum_exec_runtime = 0; | 1895 | p->se.prev_sum_exec_runtime = 0; |
1896 | p->se.last_wakeup = 0; | ||
1897 | p->se.avg_overlap = 0; | ||
1895 | 1898 | ||
1896 | #ifdef CONFIG_SCHEDSTATS | 1899 | #ifdef CONFIG_SCHEDSTATS |
1897 | p->se.wait_start = 0; | 1900 | p->se.wait_start = 0; |