aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Segall <bsegall@google.com>2014-05-15 18:59:20 -0400
committerIngo Molnar <mingo@kernel.org>2014-05-22 05:16:25 -0400
commit3944a9274ef6cda0cc282daf0739832f661670f7 (patch)
tree915704002a970ef8e8f359734355a0784d935088
parent6669dc89078da020241e78e5589489e494203332 (diff)
sched: Fix exec_start/task_hot on migrated tasks
task_hot checks exec_start on any runnable task, but if it has been migrated since the it last ran, then exec_start is a clock_task from another cpu. If the old cpu's clock_task was sufficiently far ahead of this cpu's then the task will not be considered for another migration until it has run. Instead reset exec_start whenever a task is migrated, since it is presumably no longer hot anyway. Signed-off-by: Ben Segall <bsegall@google.com> [ Made it compile. ] Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20140515225920.7179.13924.stgit@sword-of-the-dawn.mtv.corp.google.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 28ccf502c63c..dd3fa14a2998 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4544,6 +4544,9 @@ migrate_task_rq_fair(struct task_struct *p, int next_cpu)
4544 atomic_long_add(se->avg.load_avg_contrib, 4544 atomic_long_add(se->avg.load_avg_contrib,
4545 &cfs_rq->removed_load); 4545 &cfs_rq->removed_load);
4546 } 4546 }
4547
4548 /* We have migrated, no longer consider this task hot */
4549 se->exec_start = 0;
4547} 4550}
4548#endif /* CONFIG_SMP */ 4551#endif /* CONFIG_SMP */
4549 4552