From: Frederic Weisbecker move_tasks() and active_load_balance_cpu_stop() both need to have the busiest rq clock uptodate because they may end up calling can_migrate_task() that uses rq->clock_task to determine if the task running in the busiest runqueue is cache hot. Hence if the busiest runqueue is tickless, update its clock before reading it. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Daniel Lezcano Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: Ingo Molnar Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner [ Forward port conflicts ] Signed-off-by: Steven Rostedt --- kernel/sched/fair.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f320922..a63e641 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4231,6 +4231,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, { int ld_moved, cur_ld_moved, active_balance = 0; int lb_iterations, max_lb_iterations; + int clock_updated; struct sched_group *group; struct rq *busiest; unsigned long flags; @@ -4274,6 +4275,7 @@ redo: ld_moved = 0; lb_iterations = 1; + clock_updated = 0; if (busiest->nr_running > 1) { /* * Attempt to move tasks. If find_busiest_group has found @@ -4297,6 +4299,14 @@ more_balance: */ cur_ld_moved = move_tasks(&env); ld_moved += cur_ld_moved; + + /* + * Move tasks may end up calling can_migrate_task() which + * requires an uptodate value of the rq clock. + */ + update_nohz_rq_clock(busiest); + clock_updated = 1; + double_rq_unlock(env.dst_rq, busiest); local_irq_restore(flags); @@ -4392,6 +4402,13 @@ more_balance: busiest->active_balance = 1; busiest->push_cpu = this_cpu; active_balance = 1; + /* + * active_load_balance_cpu_stop may end up calling + * can_migrate_task() which requires an uptodate + * value of the rq clock. + */ + if (!clock_updated) + update_nohz_rq_clock(busiest); } raw_spin_unlock_irqrestore(&busiest->lock, flags); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/