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] [day] [month] [year] [list]
Message-ID: <CAKfTPtA_1uQ6s5fMw1g0N8tOLD4s0orD_yv=1-+yOS73Jpu5OA@mail.gmail.com>
Date: Thu, 11 Sep 2025 10:28:59 +0200
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Yury Norov <yury.norov@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>, 
	Juri Lelli <juri.lelli@...hat.com>, Dietmar Eggemann <dietmar.eggemann@....com>, 
	Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>, 
	Valentin Schneider <vschneid@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: fair: drop useless cpumask_empty() in find_energy_efficient_cpu()

On Thu, 11 Sept 2025 at 04:34, Yury Norov <yury.norov@...il.com> wrote:
>
> From: Yury Norov (NVIDIA) <yury.norov@...il.com>
>
> cpumask_empty() call is O(N) and useless, because the previous
> cpumask_and() returns false for empty 'cpus'.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>

Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>

> ---
>  kernel/sched/fair.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index b173a059315c..7229339cbb1b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8320,9 +8320,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
>                 int max_spare_cap_cpu = -1;
>                 int fits, max_fits = -1;
>
> -               cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask);
> -
> -               if (cpumask_empty(cpus))
> +               if (!cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask))
>                         continue;
>
>                 /* Account external pressure for the energy estimation */
> --
> 2.43.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ