/* The idle thread. There's no useful work to be done, so just try to conserve power and have a low exit latency (ie sit in a loop waiting for somebody to say that they'd like to reschedule)  */
void cpu_idle(void)
/* The idle thread. There's no useful work to be done, so just try to conserve power and have a low exit latency (ie sit in a loop waiting for somebody to say that they'd like to reschedule)  */
void cpu_idle(void)
{
	int cpu = smp_processor_id();
	boot_init_stack_canary();
	current_thread_info()->status |= TS_POLLING;
	while (1) {
		tick_nohz_stop_sched_tick(1);
		while (!need_resched()) {
			check_pgt_cache();
			rmb();
			if (cpu_is_offline(cpu))
				play_dead();
			local_irq_disable();
			stop_critical_timings();
			pm_idle();
			start_critical_timings();
		}
		tick_nohz_restart_sched_tick();
		preempt_enable_no_resched();
		schedule();
		preempt_disable();
	}
}