|
@@ -4603,7 +4603,7 @@ static void nohz_balancer_kick(int cpu)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
-static inline void clear_nohz_tick_stopped(int cpu)
|
|
|
|
|
|
+static inline void nohz_balance_exit_idle(int cpu)
|
|
{
|
|
{
|
|
if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
|
|
if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
|
|
cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
|
|
cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
|
|
@@ -4643,28 +4643,23 @@ void set_cpu_sd_state_idle(void)
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
- * This routine will record that this cpu is going idle with tick stopped.
|
|
|
|
|
|
+ * This routine will record that the cpu is going idle with tick stopped.
|
|
* This info will be used in performing idle load balancing in the future.
|
|
* This info will be used in performing idle load balancing in the future.
|
|
*/
|
|
*/
|
|
-void select_nohz_load_balancer(int stop_tick)
|
|
|
|
|
|
+void nohz_balance_enter_idle(int cpu)
|
|
{
|
|
{
|
|
- int cpu = smp_processor_id();
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* If this cpu is going down, then nothing needs to be done.
|
|
* If this cpu is going down, then nothing needs to be done.
|
|
*/
|
|
*/
|
|
if (!cpu_active(cpu))
|
|
if (!cpu_active(cpu))
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (stop_tick) {
|
|
|
|
- if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
|
|
|
|
- return;
|
|
|
|
|
|
+ if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
|
|
|
|
+ return;
|
|
|
|
|
|
- cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
|
|
|
|
- atomic_inc(&nohz.nr_cpus);
|
|
|
|
- set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
|
|
|
|
- }
|
|
|
|
- return;
|
|
|
|
|
|
+ cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
|
|
|
|
+ atomic_inc(&nohz.nr_cpus);
|
|
|
|
+ set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
|
|
}
|
|
}
|
|
|
|
|
|
static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
|
|
static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
|
|
@@ -4672,7 +4667,7 @@ static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
|
|
{
|
|
{
|
|
switch (action & ~CPU_TASKS_FROZEN) {
|
|
switch (action & ~CPU_TASKS_FROZEN) {
|
|
case CPU_DYING:
|
|
case CPU_DYING:
|
|
- clear_nohz_tick_stopped(smp_processor_id());
|
|
|
|
|
|
+ nohz_balance_exit_idle(smp_processor_id());
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
default:
|
|
default:
|
|
return NOTIFY_DONE;
|
|
return NOTIFY_DONE;
|
|
@@ -4833,7 +4828,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
|
|
* busy tick after returning from idle, we will update the busy stats.
|
|
* busy tick after returning from idle, we will update the busy stats.
|
|
*/
|
|
*/
|
|
set_cpu_sd_state_busy();
|
|
set_cpu_sd_state_busy();
|
|
- clear_nohz_tick_stopped(cpu);
|
|
|
|
|
|
+ nohz_balance_exit_idle(cpu);
|
|
|
|
|
|
/*
|
|
/*
|
|
* None are in tickless mode and hence no need for NOHZ idle load
|
|
* None are in tickless mode and hence no need for NOHZ idle load
|