/** * tick_nohz_idle_enter - stop the idle tick from the idle task * * When the next event is more than a tick into the future, stop the idle tick * Called when we start the idle loop. * * The arch is responsible of calling: * * - rcu_idle_enter() after its last use of RCU before the CPU is put * to sleep. * - rcu_idle_exit() before the first use of RCU after the CPU is woken up. */ void tick_nohz_idle_enter(void) { struct tick_sched *ts; WARN_ON_ONCE(irqs_disabled()); /* * Update the idle state in the scheduler domain hierarchy * when tick_nohz_stop_sched_tick() is called from the idle loop. * State will be updated to busy during the first busy tick after * exiting idle. */ set_cpu_sd_state_idle(); local_irq_disable(); ts = &__get_cpu_var(tick_cpu_sched); /* * set ts->inidle unconditionally. even if the system did not * switch to nohz mode the cpu frequency governers rely on the * update of the idle time accounting in tick_nohz_start_idle(). */ ts->inidle = 1; tick_nohz_stop_sched_tick(ts); local_irq_enable(); }
void tick_nohz_idle_enter(void) { struct tick_sched *ts; WARN_ON_ONCE(irqs_disabled()); set_cpu_sd_state_idle(); local_irq_disable(); ts = &__get_cpu_var(tick_cpu_sched); ts->inidle = 1; tick_nohz_stop_sched_tick(ts); local_irq_enable(); }