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: <20211101111840.GT3891@suse.de>
Date:   Mon, 1 Nov 2021 11:18:40 +0000
From:   Mel Gorman <mgorman@...e.de>
To:     Yuan ZhaoXiong <yuanzhaoxiong@...du.com>
Cc:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, bristot@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Simplify task_numa_find_cpu()

On Sat, Oct 30, 2021 at 03:25:59PM +0800, Yuan ZhaoXiong wrote:
> Combine the 'cpumask_of_node()' with 'env->p->cpus_ptr' and drop the
> cpumask_test_cpu().
> 
> Signed-off-by: Yuan ZhaoXiong <yuanzhaoxiong@...du.com>

This potentially creates of a temporary cpumask variable as noted in the
comment for for_each_cpu_and.

 * This saves a temporary CPU mask in many places.  It is equivalent to:
 *      struct cpumask tmp;
 *      cpumask_and(&tmp, &mask1, &mask2);
 *      for_each_cpu(cpu, &tmp)
 *              ...

task_numa_find_cpu() is a relatively deep function. Did you check
the stack usage to make sure it's not pushing too close to the stack
boundary? While there are other users of for_each_cpu_and, they are mostly
shallow although find_energy_efficient_cpu() is a bit questionable and
probably should have used select_idle_mask.

Does the patch have a noticable performance impact? 

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ