aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2017-06-18 22:12:01 -0400
committerIngo Molnar <mingo@kernel.org>2017-06-22 05:30:01 -0400
commita0db971e4eb69fc84eb3d7ef94f718b483550b4a (patch)
treed9bfbe541b9e7e83f304932da94a5053e934aae5
parent3c85d6db5e5f05ae6c3d7f5a0ceceb43746a5ca7 (diff)
nohz: Move idle balancer registration to the idle path
The idle load balancing registration path assumes that we only stop the tick when the CPU is idle, ignoring the nohz full case. As a result, a nohz full CPU that is running a task may be chosen to perform idle load balancing. Lets make sure that only CPUs in dynticks idle mode can be picked as idle load balancers. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Rik van Riel <riel@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1497838322-10913-3-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/time/tick-sched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index b1b58a07e042..db023e9cbb25 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -782,7 +782,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
782 * the scheduler tick in nohz_restart_sched_tick. 782 * the scheduler tick in nohz_restart_sched_tick.
783 */ 783 */
784 if (!ts->tick_stopped) { 784 if (!ts->tick_stopped) {
785 nohz_balance_enter_idle(cpu);
786 calc_load_nohz_start(); 785 calc_load_nohz_start();
787 cpu_load_update_nohz_start(); 786 cpu_load_update_nohz_start();
788 787
@@ -923,8 +922,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
923 ts->idle_expires = expires; 922 ts->idle_expires = expires;
924 } 923 }
925 924
926 if (!was_stopped && ts->tick_stopped) 925 if (!was_stopped && ts->tick_stopped) {
927 ts->idle_jiffies = ts->last_jiffies; 926 ts->idle_jiffies = ts->last_jiffies;
927 nohz_balance_enter_idle(cpu);
928 }
928 } 929 }
929} 930}
930 931