Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp874418ybt; Wed, 1 Jul 2020 12:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGqG6h10au36Vto9uTsJ02E7CIDMqt2sVG2NuVKGdzpF0X3jrybXSWOaSkV2JKYxdcWN11 X-Received: by 2002:a17:906:9244:: with SMTP id c4mr23864082ejx.60.1593630600187; Wed, 01 Jul 2020 12:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593630600; cv=none; d=google.com; s=arc-20160816; b=SiK8ChXOOO82bSjrHD9+bhIUuQPrk6FobMXfw8dItOqUy8Cu5sivlEkZgR+JbFeDiN YTJwyIIwfKHLCdeqvVIWDcTe9FGWlaDN8rzB43ugNJ/sb6isbRpjozpGggePx8mOrn+b WpHNQdKRCe24H3GNMsNMXlo48tWF/CcycDqRaQ49dZvz28MeMK/LBHbYqkJRHsOgyyNV hCNrgfhncINJTVhlQfvRnZbKsm4qjn0DNVC5cAbL6NRHkx5qgHJK+63IBJc77tuDiOfB q/YMtHsW4ogph27VXo6OqInG7xKJ5KWfsk9qYcuiLVZTwwk6l85EzqsrwyuHqTQT7J4Q VBZw== 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=C41WxkSshq/lm2psEb7yNzRJQHTDbgfrEk/67NcguSQ=; b=s3I1hVieG13y9xH2eUYwl+ipXn7f7TPh8KykzaQykFvwIUiG1Ke7IPEoQbkaH5XO8A xqION8ZlV30BHq5HoWUus9nl8GkfYom2zJr3PxJTT7PyZVqhwYwf5z2usHLC3HqjfUR7 96rQ6bmesc6kXtBK49AMF0ecU4MdMqQeQfN7n3aL34T/vR+jT5wo2wRvIGWdmv5IUwmE +Xo7sealM2dlXg9iLjehzAbVMfwqRJkCs7EMjStIidQfuQONWZBZV/1GP2lFL8NfjcVT RWCPDXdudTt6q288vdLIJSaIpn42pkEu87Iky5k5j4GOlquS4mOQX+n1HlJOa/FA6cQ8 uf7g== 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 m9si4302219ejr.68.2020.07.01.12.09.36; Wed, 01 Jul 2020 12:10:00 -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 S1726989AbgGATHm (ORCPT + 99 others); Wed, 1 Jul 2020 15:07:42 -0400 Received: from foss.arm.com ([217.140.110.172]:39832 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbgGATH0 (ORCPT ); Wed, 1 Jul 2020 15:07:26 -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 5667011B3; Wed, 1 Jul 2020 12:07:26 -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 57C413F68F; Wed, 1 Jul 2020 12:07:25 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, morten.rasmussen@arm.com Subject: [PATCH v3 5/7] sched/topology: Add more flags to the SD degeneration mask Date: Wed, 1 Jul 2020 20:06:53 +0100 Message-Id: <20200701190656.10126-6-valentin.schneider@arm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701190656.10126-1-valentin.schneider@arm.com> References: <20200701190656.10126-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 I don't think it is going to change much in practice, but we were missing those: o SD_BALANCE_WAKE: Used just like the other SD_BALANCE_* flags, so also needs > 1 group. o SD_ASYM_PACKING: Hinges on load balancing (periodic / wakeup), thus needs > 1 group to happen o SD_OVERLAP: Describes domains with overlapping groups; can't have overlaps with a single group. SD_PREFER_SIBLING is as always the odd one out: we currently consider it in sd_parent_degenerate() but not in sd_degenerate(). It too hinges on load balancing, and thus won't have any effect when set on a domain with a single group. Add it to the sd_degenerate() groups mask. Signed-off-by: Valentin Schneider --- kernel/sched/topology.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 6047d491abe9..fe393b295444 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -161,11 +161,15 @@ static int sd_degenerate(struct sched_domain *sd) /* Following flags need at least 2 groups */ if (sd->flags & (SD_BALANCE_NEWIDLE | + SD_BALANCE_WAKE | SD_BALANCE_FORK | SD_BALANCE_EXEC | + SD_ASYM_PACKING | SD_SHARE_CPUCAPACITY | SD_ASYM_CPUCAPACITY | - SD_SHARE_PKG_RESOURCES)) { + SD_SHARE_PKG_RESOURCES | + SD_OVERLAP | + SD_PREFER_SIBLING)) { if (sd->groups != sd->groups->next) return 0; } @@ -191,11 +195,14 @@ 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_WAKE | SD_BALANCE_FORK | SD_BALANCE_EXEC | + SD_ASYM_PACKING | SD_ASYM_CPUCAPACITY | SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES | + SD_OVERLAP | SD_PREFER_SIBLING); if (nr_node_ids == 1) pflags &= ~SD_SERIALIZE; -- 2.27.0