On Mon, 2024-04-01 at 20:47 -0500, Haris Okanovic wrote: > +static int __cpuidle arm_idle_wfe_poll(struct cpuidle_device *dev, > + struct cpuidle_driver *drv, int idx) > +{ > + u64 time_start, time_limit; > + > + time_start = local_clock(); > + dev->poll_time_limit = false; > + > + local_irq_enable(); Re this comment from Peter Zijlstra [1], should I use raw_local_irq_enable() instead? I see examples of both under drivers/cpuidle/. [1] https://elixir.bootlin.com/linux/v6.9-rc2/source/include/linux/cpuidle.h#L119 > + > + if (current_set_polling_and_test()) > + goto end; > + > + time_limit = cpuidle_poll_time(drv, dev); > + > + do { > + // exclusive read arms the monitor for wfe > + if (__READ_ONCE_EX(current_thread_info()->flags) & > _TIF_NEED_RESCHED) > + goto end; > + > + // may exit prematurely, see ARM_ARCH_TIMER_EVTSTREAM > + wfe(); > + } while (local_clock() - time_start < time_limit); > + > + dev->poll_time_limit = true; > + > +end: > + current_clr_polling(); > + return idx; > +} > + Thanks, Haris Okanovic
- References:
- [PATCH 1/3] arm64: Add TIF_POLLING_NRFLAG
- From: Haris Okanovic
- [PATCH 3/3] arm64: cpuidle: Add arm_poll_idle
- From: Haris Okanovic
- [PATCH 1/3] arm64: Add TIF_POLLING_NRFLAG
- Prev by Date: [PATCH 3/3] arm64: cpuidle: Add arm_poll_idle
- Next by Date: Re: [PATCH 2/3] arm64: add __READ_ONCE_EX()
- Previous by thread: [PATCH 3/3] arm64: cpuidle: Add arm_poll_idle
- Next by thread: Re: [PATCH 3/3] arm64: cpuidle: Add arm_poll_idle
- Index(es):