Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp430246pxa; Wed, 12 Aug 2020 05:54:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCZhsObQNmFKvXkzed6YuUO3gy9kkzLr/r9h8XW5wD9mNdmVMIrWXLYBMApPSgCeEH1Ufg X-Received: by 2002:a17:906:1589:: with SMTP id k9mr30470657ejd.115.1597236874883; Wed, 12 Aug 2020 05:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597236874; cv=none; d=google.com; s=arc-20160816; b=XgE5tZEtOxw/bVR6yh+GzT2t/yfJqXtLAR++8/+OAM1pzHOmvzGWnCiYpHUoNE6gmt TpxNjUo+tgpy4bpcvVin8dvJjLdfolyDruBA2Y0HY0DR8EM0cm4v5T+h83ZQagJTg3kj wtMdTqA2klgyHel1k+5so0F+NRe+v26uQQmk3oWtOK7+EOckapRZVrxGmcnUk7ENAgp1 zkJzWr8Wmfx7XSv8PTeafrLbuwCYqPWFLfeYaiCVCW1hMXN6TaenyVyvx2smVdBKyYcv snO4S/ZrBb6hggiqPxv5GfChs8jecqW86xrfsIdOsPhU/CiT1ZGQlvW1JH5KLX+HbGNU L/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VOh4dVS8Mlob1EWJQSg7rkJjA9DrEG3lAT4lYG17GhA=; b=MAgR7Mo15QQiOitO918CfYoAeeuCcI8vKIAGKsSblFSbEpuK4zyhs15wSObbH7GZgH KWg7TMxRXmB7MpUYxsgZvnxw03mccOWiJbIIFAWuC3YIvd/f288swkfqps68Y2/kR7ai vRwPGyjYLWblZb0b0y3njZZ/S3TttI2pqHsuHIMPxynJ2Urvx8gZsZYHm4S8ZwZdZbtR TFhErrutjnMsv9kqNzeCXTiAZG8iiUyVBoAH2NDfJnuzD1SGXu4jCDZEW8MwGFPxgNln 50g5KrbJKJp6oSH2BQVdyf8lC8MOXL635Y4BXLRSfxD/c+i0ibWjdPGeL9zKtTM5sM2K fepQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl7si1075030ejb.264.2020.08.12.05.54.12; Wed, 12 Aug 2020 05:54:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728060AbgHLMx3 (ORCPT + 99 others); Wed, 12 Aug 2020 08:53:29 -0400 Received: from foss.arm.com ([217.140.110.172]:44610 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbgHLMxY (ORCPT ); Wed, 12 Aug 2020 08:53:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 71AFE1424; Wed, 12 Aug 2020 05:53:24 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3AF7B3F70D; Wed, 12 Aug 2020 05:53:23 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Peter Zijlstra , mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com, Quentin Perret Subject: [PATCH v5 08/17] sched/topology: Use prebuilt SD flag degeneration mask Date: Wed, 12 Aug 2020 13:52:51 +0100 Message-Id: <20200812125300.11889-9-valentin.schneider@arm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200812125300.11889-1-valentin.schneider@arm.com> References: <20200812125300.11889-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Leverage SD_DEGENERATE_GROUPS_MASK in sd_degenerate() and sd_parent_degenerate(). Suggested-by: Peter Zijlstra Signed-off-by: Valentin Schneider --- kernel/sched/topology.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index f128fcf46a41..5f2bc99ff659 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -160,15 +160,9 @@ static int sd_degenerate(struct sched_domain *sd) return 1; /* Following flags need at least 2 groups */ - if (sd->flags & (SD_BALANCE_NEWIDLE | - SD_BALANCE_FORK | - SD_BALANCE_EXEC | - SD_SHARE_CPUCAPACITY | - SD_ASYM_CPUCAPACITY | - SD_SHARE_PKG_RESOURCES)) { - if (sd->groups != sd->groups->next) - return 0; - } + if ((sd->flags & SD_DEGENERATE_GROUPS_MASK) && + (sd->groups != sd->groups->next)) + return 0; /* Following flags don't use groups */ if (sd->flags & (SD_WAKE_AFFINE)) @@ -190,13 +184,7 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) /* Flags needing groups don't count if only 1 group in parent */ if (parent->groups == parent->groups->next) { - pflags &= ~(SD_BALANCE_NEWIDLE | - SD_BALANCE_FORK | - SD_BALANCE_EXEC | - SD_ASYM_CPUCAPACITY | - SD_SHARE_CPUCAPACITY | - SD_SHARE_PKG_RESOURCES | - SD_PREFER_SIBLING); + pflags &= ~(SD_DEGENERATE_GROUPS_MASK | SD_PREFER_SIBLING); if (nr_node_ids == 1) pflags &= ~SD_SERIALIZE; } -- 2.27.0