Re: [PATCH] sched/idle: Export cpu_idle_poll_ctrl() symbol

From: Ulf Hansson
Date: Fri Nov 26 2021 - 07:41:47 EST


On Thu, 25 Nov 2021 at 15:13, Maulik Shah <quic_mkshah@xxxxxxxxxxx> wrote:
>
> Hi Peter,
>
> On 11/25/2021 3:21 PM, Peter Zijlstra wrote:
> > On Thu, Nov 25, 2021 at 02:44:36PM +0530, Maulik Shah wrote:
> >> Export cpu_idle_poll_ctrl() so that module drivers can use same.
> > This does not seem like a really safe interface to expose to the
> > world.
>
> Thanks for the review.
>
> Keeping the cpuidle enabled from boot up may delay/increase the boot up
> time.
> Below is our use case to force cpuidle to stay in cpu_idle_poll().
>
> We keep cpuidle disabled from boot up using "nohlt" option of kernel
> command line which internally sets cpu_idle_force_poll = 1;
> and once the device bootup reaches till certain point (for example the
> android homescreen is up) userspace may notify a
> vendor module driver which can invoke cpu_idle_poll_ctrl(false); to come
> out of poll mode.
> So vendor module driver needs cpu_idle_poll_ctrl() exported symbol.

Waiting for the homescreen can be considered as rather late, from the
kernel boot progress point of view.

That said, I am wondering if a similar improvement can be achieved by
just allowing WFI (thus no deeper idle states) until homescreen? If
so, that can be quite easily achieved by modularizing the cpuidle-psci
driver.

[...]

Kind regards
Uffe