From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S947254AbdDTTwd (ORCPT ); Thu, 20 Apr 2017 15:52:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966660AbdDTTw0 (ORCPT ); Thu, 20 Apr 2017 15:52:26 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D4CB49C0A2 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lvenanci@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D4CB49C0A2 From: Lauro Ramos Venancio To: Peter Zijlstra Cc: lwang@redhat.com, riel@redhat.com, Mike Galbraith , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, Lauro Ramos Venancio Subject: [PATCH 1/4] sched/topology: optimize build_group_mask() Date: Thu, 20 Apr 2017 16:51:40 -0300 Message-Id: <1492717903-5195-2-git-send-email-lvenanci@redhat.com> In-Reply-To: <1492717903-5195-1-git-send-email-lvenanci@redhat.com> References: <1492717903-5195-1-git-send-email-lvenanci@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 20 Apr 2017 19:52:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/sched/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 9d4566c..f8b53b3 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -506,12 +506,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; -- 1.8.3.1