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: <013382c7-bccf-9e49-4a6b-5542cdd4abba@arm.com>
Date:   Mon, 3 May 2021 14:52:35 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Pierre.Gondois@....com, linux-kernel@...r.kernel.org,
        xuewen.yan@...soc.com, qperret@...rret.net
Cc:     Lukasz.Luba@....com, Vincent.Donnefort@....com, mingo@...hat.com,
        peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, rostedt@...dmis.org,
        bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com
Subject: Re: [PATCH v2 2/2] sched/fair: Fix negative energy delta in
 find_energy_efficient_cpu()

On 29/04/2021 12:19, Pierre.Gondois@....com wrote:
> From: Pierre Gondois <Pierre.Gondois@....com>

[...]

> @@ -6680,25 +6686,23 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
>  			}
>  		}
>  	}
> -unlock:
> +

No need for empty line.

>  	rcu_read_unlock();
>  
>  	/*
>  	 * Pick the best CPU if prev_cpu cannot be used, or if it saves at
>  	 * least 6% of the energy used by prev_cpu.
>  	 */
> -	if (prev_delta == ULONG_MAX)
> -		return best_energy_cpu;
> -
> -	if ((prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
> -		return best_energy_cpu;
> +	if ((prev_delta == ULONG_MAX) ||
> +		(prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
> +		target = best_energy_cpu;

       if ((prev_delta == ULONG_MAX) ||
-               (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
+           (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
                target = best_energy_cpu;

IMHO, using whitespaces to align both sub-conditions here makes it more
readable. Especially since braces aren't required around single
statements with a condition spanning over multiple lines.

[...]

With these minor things sorted:

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ