lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 25 Nov 2021 18:26:01 +0100
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Maulik Shah <quic_mkshah@...cinc.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>
Cc:     bjorn.andersson@...aro.org, linux-arm-msm@...r.kernel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        ulf.hansson@...aro.org, quic_lsrao@...cinc.com,
        rnayak@...eaurora.org, Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH] sched/idle: Export cpu_idle_poll_ctrl() symbol

On 25/11/2021 15:13, Maulik Shah 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.
> 
> We can not take PM-QoS from driver to prevent deep cpuidle since all the
> vendor modules are kept in a separate partition and will be loaded only
> after kernel boot up is done
> and by this time kernel already starts executing deep cpuidle modes.
>>
>> Surely the better solution is to rework things to not rely on this. I'm
>> fairly sure it's not hard to write a cpuidle driver that does much the
>> same.
> The other option i think is to pass cpuidle.off=1 in kernel command line
> and then add enable_cpuidle() in drivers/cpuidle/cpuidle.c
> something similar as below which can be called by vendor module.
> 
> void enable_cpuidle(void)
> {
>         off = 0;
> }
> EXPORT_SYMBOL_GPL(enable_cpuidle);
> 
> This may be a good option since we have already disable_cpuidle() but
> not enable_cpuidle().
> 
> void disable_cpuidle(void)
> {
>         off = 1;
> }
> 
> Hi Rafael/Daniel, can you please let me know your suggestion on
> this/similar implementation?

Did you try to use the QoS latency? Sounds like it is exactly for this
purpose.

Set it to zero to force cpuidle to choose the shallowest idle state and
then INT_MAX to disable the constraint.

 cpu_latency_qos_add_request();

Hope that helps

  -- Daniel

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ