All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: fix exec_start/task_hot on migrated tasks
@ 2014-05-15 22:59 Ben Segall
  2014-05-16  8:04 ` Peter Zijlstra
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ben Segall @ 2014-05-15 22:59 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar; +Cc: linux-kernel

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>
---
 kernel/sched/fair.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 28ccf50..9f8dfeb 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)
 		atomic_long_add(se->avg.load_avg_contrib,
 						&cfs_rq->removed_load);
 	}
+
+	/* We have migrated, no longer consider this task hot */
+	se.exec_start = 0;
 }
 #endif /* CONFIG_SMP */
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-05-22 12:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 22:59 [PATCH] sched: fix exec_start/task_hot on migrated tasks Ben Segall
2014-05-16  8:04 ` Peter Zijlstra
2014-05-16 13:57   ` Preeti Murthy
2014-05-16 14:17     ` Peter Zijlstra
2014-05-19  8:13       ` Preeti U Murthy
2014-05-16 10:20 ` Peter Zijlstra
2014-05-16 16:57   ` bsegall
2014-05-19 13:07 ` [tip:sched/core] sched: Fix " tip-bot for Ben Segall
2014-05-22 12:26 ` tip-bot for Ben Segall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.