From: Frederic Weisbecker Date: Thu, 11 Apr 2013 23:50:58 +0000 (+0200) Subject: sched: Update rq clock before migrating tasks out of dying CPU X-Git-Tag: firefly_0821_release~176^2~5830^2~38 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=77bd39702f0b3840cea17681409270b16a3b93c0;p=firefly-linux-kernel-4.4.55.git sched: Update rq clock before migrating tasks out of dying CPU Because the sched_class::put_prev_task() callback of rt and fair classes are referring to the rq clock to update their runtime statistics. There is a missing rq clock update from the CPU hotplug notifier's entry point of the scheduler. Signed-off-by: Frederic Weisbecker Cc: Li Zhong Cc: Steven Rostedt Cc: Paul Turner Cc: Mike Galbraith Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/1365724262-20142-2-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 79e48e6a9385..7bf0418dc60f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4378,6 +4378,13 @@ static void migrate_tasks(unsigned int dead_cpu) */ rq->stop = NULL; + /* + * put_prev_task() and pick_next_task() sched + * class method both need to have an up-to-date + * value of rq->clock[_task] + */ + update_rq_clock(rq); + for ( ; ; ) { /* * There's this thread running, bail when that's the only