diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 5f3a52387c84..1b9856cd08ab 100755 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -229,6 +229,7 @@ exit_idle: */ static void do_idle(void) { + int cpu = smp_processor_id(); /* * If the arch has a polling bit, we maintain an invariant: * @@ -246,7 +247,7 @@ static void do_idle(void) check_pgt_cache(); rmb(); - if (cpu_is_offline(smp_processor_id())) { + if (cpu_is_offline(cpu)) { tick_nohz_idle_stop_tick_protected(); cpuhp_report_idle_dead(); arch_cpu_idle_dead();