Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3820720iog; Tue, 28 Jun 2022 03:32:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1spNRkxX4vP8hIBvqWRIUxx0debCzjfD1qeGeO1NCK6JBZxxbp/ts1uGABfovl10vQAi2rS X-Received: by 2002:a05:6402:51c7:b0:437:a22c:60f5 with SMTP id r7-20020a05640251c700b00437a22c60f5mr8206316edd.281.1656412377445; Tue, 28 Jun 2022 03:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656412377; cv=none; d=google.com; s=arc-20160816; b=ssz0D2tpr1TOnFBzc05sLABo0oCJ3+aBTdqbp3cfideXSWDqR4THm8D/VCC2OnNQjz xl/ytzLEkTDbAJSdSVZN7u5f7QGIMInJ+agYV1REMjVIu8XHabyH9tDd6lAWnCL3uUtr A3bc9aPGRa5IePhMW0vqL7vb2hZoJloKRxXq3mZvVNtNxWCv0oyY9+4U1scrHBvbEi9f p+rzFqeGzlT1eRtzrKffiIL5JFYlMT2iyDYXFlW+5vXhwsiZxUcSIpHWt4aZCh+lwju/ EhPC8wKj9W3S3oIm+u13v3s5HBHL/feNXH87wYziPNvWow7ruixAUOrvZrov75UT+Fur yONg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tr8hNJ5eGXGi4MzVwC12AfLwt6PrO5SxdG32nN7sPTs=; b=x2esU8tTBFcvMCRYKAgOXD0sjiJQNc6YKVaMdeJ9U2GmDKF8xFfTgzSsSPHm3Qjyzz iQWidWqLunLoS/hV8NOUBgdqA0F6P3V++8wszDDJhJGPDcUiZt/6Q1FTSiQ0Bz3ME4Ul Mfn3PScrRQiPmwS66ctEVuOKO+qL6z66rPzdes/mL6KtGPniyl0t+iM1Po+71+Cc0QYV IORmSQ0qNQz0j59XooUfspulP0NQVD1yZ7RIoYylZ3CG+72hxD/GpYvLZMeBkYVPN2LY TRB6qYJgkKaJiF7X/zGtlHT+loscibvrZ1kUHjgS9H42fqGNK41KLAX6uXbsei7uQDx5 6l+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DGI2+bQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ka6-20020a170907990600b007157983a2d2si15613077ejc.146.2022.06.28.03.32.29; Tue, 28 Jun 2022 03:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DGI2+bQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343862AbiF1K2V (ORCPT + 99 others); Tue, 28 Jun 2022 06:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237103AbiF1K2T (ORCPT ); Tue, 28 Jun 2022 06:28:19 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF751CB18 for ; Tue, 28 Jun 2022 03:28:18 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id i15so21521046ybp.1 for ; Tue, 28 Jun 2022 03:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tr8hNJ5eGXGi4MzVwC12AfLwt6PrO5SxdG32nN7sPTs=; b=DGI2+bQiZLRn7rOb21b70S3FwW5tLVuBbW1gU/KvN5VsrzkyQRAJKYRqO+5v/wyKLv SMPsnPa5AS5TofF80RGOdathylRq17vYNqTSKeFqG/wpo9IxO7Ra6A3OXIRf8WTAXFXG kfcJoq0WNCTSw+gHySXvUnAOGBybi9F/QGTDXbDI3nOKbJK9R11vuUDsYHmyGnpnbZ6s 7kv4vHsU7Ll9Aa7Xrk0nVtCTeVYc01+UH9PCt0Fm6En6jMiI/DevzD2JHyytHDdSnTka CT6F7659sEP10CEDPUiAe3fzfVFjegKShwTBtgYlstEGfd4pZ73Ak11hOSc4zS7HBsUf DNpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tr8hNJ5eGXGi4MzVwC12AfLwt6PrO5SxdG32nN7sPTs=; b=v7mCmNXbQhX8m/XyNXiRPSJDSXebvUAgefegyA7NsxNxo/FnbIL/VkFfRdrSE95Y8p r5UBv3KRacsQOo7/aFBpbtPsbUswhk1rpfs0s18FLGih9FpDy+qzGStzj5HSfGWE4SDV gxRCJ9Ue1us5PkrzA+/NJnBIauxu5cvypVbzvOkgCTHmeoIKJlsqDLQMr/ld77hjJFor XAOsj/D5scWE1K0/4wdmXzKRppApTFLP93uwB/iWQhmO9lUO364zCuJ96pcd3D+l+eTd i71Tp83X80L6B6TU3VXy/UTpT4sb3aLS8yf8fciMBte2IDjkq2Tz4H7x3fuFwTM2SlU4 HIpw== X-Gm-Message-State: AJIora8GHaJbM5wR+FfTl6TcI0Y3Z+eiK1IrsROS8M+NkJh12COhKKZd jldW1ssLSfOi8/24io3eAcbyGwktNxiiHVtEvI3K8A== X-Received: by 2002:a25:e695:0:b0:66c:faea:ca55 with SMTP id d143-20020a25e695000000b0066cfaeaca55mr7128367ybh.300.1656412098004; Tue, 28 Jun 2022 03:28:18 -0700 (PDT) MIME-Version: 1.0 References: <20220627165047.336669-1-sudeep.holla@arm.com> <20220627165047.336669-17-sudeep.holla@arm.com> In-Reply-To: <20220627165047.336669-17-sudeep.holla@arm.com> From: Vincent Guittot Date: Tue, 28 Jun 2022 12:28:05 +0200 Message-ID: Subject: Re: [PATCH v5 16/19] arch_topology: Limit span of cpu_clustergroup_mask() To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Atish Patra , Atish Patra , Dietmar Eggemann , Qing Wang , Rob Herring , "Rafael J . Wysocki" , Ionela Voinescu , Pierre Gondois , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Darren Hart Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Jun 2022 at 18:51, Sudeep Holla wrote: > > From: Ionela Voinescu > > Currently the cluster identifier is not set on DT based platforms. > The reset or default value is -1 for all the CPUs. Once we assign the > cluster identifier values correctly, the cluster_sibling mask will be > populated and returned by cpu_clustergroup_mask() to contribute in the > creation of the CLS scheduling domain level, if SCHED_CLUSTER is > enabled. > > To avoid topologies that will result in questionable or incorrect > scheduling domains, impose restrictions regarding the span of clusters, > as presented to scheduling domains building code: cluster_sibling should > not span more or the same CPUs as cpu_coregroup_mask(). > > This is needed in order to obtain a strict separation between the MC and > CLS levels, and maintain the same domains for existing platforms in > the presence of CONFIG_SCHED_CLUSTER, where the new cluster information > is redundant and irrelevant for the scheduler. > > While previously the scheduling domain builder code would have removed MC > as redundant and kept CLS if SCHED_CLUSTER was enabled and the > cpu_coregroup_mask() and cpu_clustergroup_mask() spanned the same CPUs, > now CLS will be removed and MC kept. > > Link: https://lore.kernel.org/r/20220621192034.3332546-18-sudeep.holla@arm.com > Cc: Darren Hart > Tested-by: Ionela Voinescu > Signed-off-by: Ionela Voinescu > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 46fa1b70b02b..277b65cf3306 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -686,6 +686,14 @@ const struct cpumask *cpu_coregroup_mask(int cpu) > > const struct cpumask *cpu_clustergroup_mask(int cpu) > { > + /* > + * Forbid cpu_clustergroup_mask() to span more or the same CPUs as > + * cpu_coregroup_mask(). > + */ > + if (cpumask_subset(cpu_coregroup_mask(cpu), > + &cpu_topology[cpu].cluster_sibling)) > + return get_cpu_mask(cpu); AFAICT, this will change the Altra scheduling topology which will now have a MC level instead of the CLS but it's probably not a problem as the flags are the same for now Acked-by: Vincent Guittot > + > return &cpu_topology[cpu].cluster_sibling; > } > > -- > 2.36.1 >