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: Fri, 7 Jun 2024 10:14:38 +0200
From: Dietmar Eggemann <dietmar.eggemann@....com>
To: Christian Loehle <christian.loehle@....com>, linux-pm@...r.kernel.org,
 linux-kernel@...r.kernel.org, rafael@...nel.org
Cc: vincent.guittot@...aro.org, qyousef@...alina.io, peterz@...radead.org,
 daniel.lezcano@...aro.org, anna-maria@...utronix.de,
 kajetan.puchalski@....com, lukasz.luba@....com
Subject: Re: [PATCH 4/6] cpuidle: teo: Increase minimum time to stop tick

On 06/06/2024 11:00, Christian Loehle wrote:
> Since stopping the tick isn't free, add at least some minor constant
> (1ms) for the threshold to stop the tick.

Sounds pretty arbitrary to me? 'duration_ns' is either based on
target_residency_ns or tick_nohz_get_sleep_length() or even set to
TICK_NSEC/2. Does adding 1ms makes sense to all these cases? But then
why 1ms?

> Signed-off-by: Christian Loehle <christian.loehle@....com>
> ---
>  drivers/cpuidle/governors/teo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
> index 216d34747e3b..ca9422bbd8db 100644
> --- a/drivers/cpuidle/governors/teo.c
> +++ b/drivers/cpuidle/governors/teo.c
> @@ -622,10 +622,10 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
>  	/*
>  	 * Allow the tick to be stopped unless the selected state is a polling
>  	 * one or the expected idle duration is shorter than the tick period
> -	 * length.
> +	 * length plus some constant (1ms) to account for stopping it.
>  	 */
>  	if ((!(drv->states[idx].flags & CPUIDLE_FLAG_POLLING) &&
> -	    duration_ns >= TICK_NSEC) || tick_nohz_tick_stopped())
> +	    duration_ns > NSEC_PER_MSEC + TICK_NSEC) || tick_nohz_tick_stopped())
>  		return idx;
>  
>  out_tick_state:


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ