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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0021de2a-9342-4e3c-ac71-57ecf6935339@arm.com>
Date: Wed, 15 Jan 2025 19:44:36 +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>
Subject: Re: [PATCH v1 3/9] cpuidle: teo: Combine candidate state index checks
 against 0

On 1/13/25 18:39, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> 
> There are two candidate state index checks against 0 in teo_select()
> that need not be separate, so combine them and update comments around
> them.
> 
> No intentional functional impact.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> 
> This is a rebased variant of
> 
> https://lore.kernel.org/linux-pm/2296767.iZASKD2KPV@rjwysocki.net/
> 
> ---
>  drivers/cpuidle/governors/teo.c |   23 +++++++++--------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
> 
> --- a/drivers/cpuidle/governors/teo.c
> +++ b/drivers/cpuidle/governors/teo.c
> @@ -436,24 +436,19 @@
>  	if (idx > constraint_idx)
>  		idx = constraint_idx;
>  
> -	if (!idx && prev_intercept_idx) {
> -		/*
> -		 * We have to query the sleep length here otherwise we don't
> -		 * know after wakeup if our guess was correct.
> -		 */
> -		duration_ns = tick_nohz_get_sleep_length(&delta_tick);
> -		cpu_data->sleep_length_ns = duration_ns;
> +	if (!idx) {
> +		if (prev_intercept_idx) {
> +			/*
> +			 * Query the sleep length to be able to count the wakeup
> +			 * as a hit if it is caused by a timer.
> +			 */
> +			duration_ns = tick_nohz_get_sleep_length(&delta_tick);
> +			cpu_data->sleep_length_ns = duration_ns;
> +		}
>  		goto out_tick;
>  	}
>  
>  	/*
> -	 * Skip the timers check if state 0 is the current candidate one,
> -	 * because an immediate non-timer wakeup is expected in that case.
> -	 */
> -	if (!idx)
> -		goto out_tick;
> -
> -	/*
>  	 * If state 0 is a polling one, check if the target residency of
>  	 * the current candidate state is low enough and skip the timers
>  	 * check in that case too.
> 
> 
> 

This patch relies on the previous one, but given that you'll probably
convince me on that:
Reviewed-by: Christian Loehle <christian.loehle@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ