From: Lauro Ramos Venancio Date: Thu, 20 Apr 2017 19:51:40 +0000 (-0300) Subject: sched/topology: Optimize build_group_mask() X-Git-Tag: C0P2-H0.0--20200415~8147 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=3e165b2322c6a7e50031cb91ef95ee6cb4e1d163;p=linux.git sched/topology: Optimize build_group_mask() commit f32d782e31bf079f600dcec126ed117b0577e85c upstream. The group mask is always used in intersection with the group CPUs. So, when building the group mask, we don't have to care about CPUs that are not part of the group. Signed-off-by: Lauro Ramos Venancio Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: lwang@redhat.com Cc: riel@redhat.com Link: http://lkml.kernel.org/r/1492717903-5195-2-git-send-email-lvenanci@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 19f84d98d24c..326be9da4ee4 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6113,12 +6113,12 @@ enum s_alloc { */ static void build_group_mask(struct sched_domain *sd, struct sched_group *sg) { - const struct cpumask *span = sched_domain_span(sd); + const struct cpumask *sg_span = sched_group_cpus(sg); struct sd_data *sdd = sd->private; struct sched_domain *sibling; int i; - for_each_cpu(i, span) { + for_each_cpu(i, sg_span) { sibling = *per_cpu_ptr(sdd->sd, i); if (!cpumask_test_cpu(i, sched_domain_span(sibling))) continue;