lkml.org 
[lkml]   [2021]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@baidu.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

\
 
 \ /
  Last update: 2021-11-01 12:19    [W:0.032 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site