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: <29534bd1-1628-e0fb-eb81-6b789133ff43@gentwo.org>
Date: Mon, 5 Aug 2024 16:07:20 -0700 (PDT)
From: "Christoph Lameter (Ampere)" <cl@...two.org>
To: Ankur Arora <ankur.a.arora@...cle.com>
cc: linux-pm@...r.kernel.org, kvm@...r.kernel.org, 
    linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
    catalin.marinas@....com, will@...nel.org, tglx@...utronix.de, 
    mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, 
    x86@...nel.org, hpa@...or.com, pbonzini@...hat.com, wanpengli@...cent.com, 
    vkuznets@...hat.com, rafael@...nel.org, daniel.lezcano@...aro.org, 
    peterz@...radead.org, arnd@...db.de, lenb@...nel.org, mark.rutland@....com, 
    harisokn@...zon.com, mtosatti@...hat.com, sudeep.holla@....com, 
    misono.tomohiro@...itsu.com, joao.m.martins@...cle.com, 
    boris.ostrovsky@...cle.com, konrad.wilk@...cle.com
Subject: Re: [PATCH v6 01/10] cpuidle/poll_state: poll via
 smp_cond_load_relaxed()

On Fri, 26 Jul 2024, Ankur Arora wrote:

> diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c
> index 9b6d90a72601..532e4ed19e0f 100644
> --- a/drivers/cpuidle/poll_state.c
> +++ b/drivers/cpuidle/poll_state.c
> @@ -21,21 +21,21 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev,
>
> 	raw_local_irq_enable();
> 	if (!current_set_polling_and_test()) {
> -		unsigned int loop_count = 0;
> +		unsigned int loop_count;
> 		u64 limit;

loop_count is only used in the while loop below. So the declaration 
could be placed below the while.

>
> 		limit = cpuidle_poll_time(drv, dev);
>
> 		while (!need_resched()) {
> -			cpu_relax();
> -			if (loop_count++ < POLL_IDLE_RELAX_COUNT)
> -				continue;
> -
> 			loop_count = 0;
> 			if (local_clock_noinstr() - time_start > limit) {
> 				dev->poll_time_limit = true;
> 				break;
> 			}

Looks ok otherwise

Reviewed-by: Christoph Lameter <cl@...ux.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ