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]
Message-ID: <6dbc4f0a-4bcf-4539-bd39-5cc9d31a5bcf@arm.com>
Date: Mon, 17 Feb 2025 13:08:35 +0000
From: Christian Loehle <christian.loehle@....com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
 Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Daniel Lezcano <daniel.lezcano@...aro.org>,
 Artem Bityutskiy <artem.bityutskiy@...ux.intel.com>,
 Aboorva Devarajan <aboorvad@...ux.ibm.com>
Subject: Re: [RFT][PATCH v1 3/5] cpuidle: menu: Tweak threshold use in
 get_typical_interval()

On 2/6/25 14:25, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> To prepare get_typical_interval() for subsequent changes, rearrange
> the use of the data point threshold in it a bit and initialize that
> threshold to UINT_MAX which is more consistent with its data type.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>  drivers/cpuidle/governors/menu.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -116,7 +116,7 @@
>   */
>  static unsigned int get_typical_interval(struct menu_device *data)
>  {
> -	unsigned int max, divisor, thresh = INT_MAX;
> +	unsigned int max, divisor, thresh = UINT_MAX;
>  	u64 avg, variance, avg_sq;
>  	int i;
>  
> @@ -129,8 +129,8 @@
>  	for (i = 0; i < INTERVALS; i++) {
>  		unsigned int value = data->intervals[i];
>  
> -		/* Discard data points above the threshold. */
> -		if (value > thresh)
> +		/* Discard data points above or at the threshold. */
> +		if (value >= thresh)
>  			continue;
>  
>  		divisor++;
> @@ -186,7 +186,7 @@
>  	if ((divisor * 4) <= INTERVALS * 3)
>  		return UINT_MAX;
>  
> -	thresh = max - 1;
> +	thresh = max;
>  	goto again;
>  }
>  

Reviewed-by: Christian Loehle <christian.loehle@....com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ