Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c0e0da6 authored by Junjie Wu's avatar Junjie Wu
Browse files

idle: Move arch_cpu_idle_enter/exit outside tick_nohz_idle_enter/exit



arch_cpu_idle_enter/exit() send out idle notifications. Notifier
client might want to reschedule timers in the notification. However,
tick_nohz_idle_enter() would have already decided next wake up jiffy,
which could be beyond the client timer's expiration jiffy.

Move arch_cpu_idle_enter/exit() outside tick_nohz_idle_enter/exit()
so timer modification can affect next idle wake up.

Change-Id: Ifcfc06a12b0637b72d0adf0a930cac518eb74bc7
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 9f25a3ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ void __weak arch_cpu_idle(void)
static void cpu_idle_loop(void)
{
	while (1) {
		arch_cpu_idle_enter();
		tick_nohz_idle_enter();

		while (!need_resched()) {
@@ -75,7 +76,6 @@ static void cpu_idle_loop(void)
			rmb();

			local_irq_disable();
			arch_cpu_idle_enter();

			/*
			 * In poll mode we reenable interrupts and spin.
@@ -101,9 +101,9 @@ static void cpu_idle_loop(void)
				}
				__current_set_polling();
			}
			arch_cpu_idle_exit();
		}
		tick_nohz_idle_exit();
		arch_cpu_idle_exit();
		schedule_preempt_disabled();
		if (cpu_is_offline(smp_processor_id()))
			arch_cpu_idle_dead();