提交 a0db971e 编写于 作者: F Frederic Weisbecker 提交者: Ingo Molnar

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: NFrederic Weisbecker <fweisbec@gmail.com>
Acked-by: NRik 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.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 3c85d6db
...@@ -782,7 +782,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, ...@@ -782,7 +782,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
* the scheduler tick in nohz_restart_sched_tick. * the scheduler tick in nohz_restart_sched_tick.
*/ */
if (!ts->tick_stopped) { if (!ts->tick_stopped) {
nohz_balance_enter_idle(cpu);
calc_load_nohz_start(); calc_load_nohz_start();
cpu_load_update_nohz_start(); cpu_load_update_nohz_start();
...@@ -923,8 +922,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts) ...@@ -923,8 +922,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
ts->idle_expires = expires; ts->idle_expires = expires;
} }
if (!was_stopped && ts->tick_stopped) if (!was_stopped && ts->tick_stopped) {
ts->idle_jiffies = ts->last_jiffies; ts->idle_jiffies = ts->last_jiffies;
nohz_balance_enter_idle(cpu);
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册