Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3465026rwa; Tue, 23 Aug 2022 05:19:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4DlKSOUHzjQjVRfVXh39sRgyLLfBhfljSwPUaV8ORhRMTIgmgF+w69D3NuL7WgXasiJoA/ X-Received: by 2002:a17:902:d48a:b0:16f:51a:252a with SMTP id c10-20020a170902d48a00b0016f051a252amr24008937plg.71.1661257195233; Tue, 23 Aug 2022 05:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257195; cv=none; d=google.com; s=arc-20160816; b=zlrqQAj/m5eNmlSmUYg06J3Y6RyFNr0w60DuN/Isug1uKCy9u4hr5v3WryNZu3nB08 S60MqyL8VPSaRGlqtKM8mhyEBMMsEAcAXuPoYJNYpO8apyBFA/72KqBAHNFEfFVZIaCr EK0goDkcIY4wScRYQyshf6Bn277ehYT1ng/9ZX+qr1qzwVk9FIgfzHyPQIV5Ayo4WE+8 oBG0PoAnfgJXJgWOLCElI5NITd4EaETg+W/ybFdXoNdnay7RqliUj9KnIQLicDxvGKrA z7JwauQ4c9ocZokBvCuy6NMZ7Cjjo8yM7nNarVLhpvOWgW6FcDDRj6OUcxVebV1rXsLd +bsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wahJ4g294hRHmMpUOTj4GFQQtO27UBsOzQoKzutO1sM=; b=nn3lk6Fo+wKMiYbTO/nuNTgWziFQ5OlW0R24ecVe1sEJHveZfJ76EULy+8KhScqWfv cYBXXWctZjGd62Jts3jGk0P/kFic8GrE39w9gqa+Vg2pq7dQ510PD9ZKVQOuco2pP5JF ufr4qMkRsvEVzMUN78kvXY2dzEs9brEeGxNaeVepDLQx8u1bbtJy+9/DB8gmkm6LTm0F SZX2JNgKQpTi9dGyNU55O01dfsH28Djf0O2sFzTy0CP4Ua2OZlGjbL2xW30SoDQ852lK 5Vv0I6yWe7fXgn+UNkIwWufPwu5xPh5sxHFmNmnPCMi1CunCbO/XuLPwLRebkpyZkIVV LD9Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a23-20020a62bd17000000b005369ebcc5cesi5987359pff.79.2022.08.23.05.19.43; Tue, 23 Aug 2022 05:19:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357588AbiHWL01 (ORCPT + 99 others); Tue, 23 Aug 2022 07:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357715AbiHWLUz (ORCPT ); Tue, 23 Aug 2022 07:20:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47B1F8C46C for ; Tue, 23 Aug 2022 02:22:49 -0700 (PDT) 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 DBB0D113E; Tue, 23 Aug 2022 02:22:51 -0700 (PDT) Received: from bogus (unknown [10.57.44.200]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A16143F718; Tue, 23 Aug 2022 02:22:45 -0700 (PDT) Date: Tue, 23 Aug 2022 10:22:20 +0100 From: Sudeep Holla To: Yicong Yang Cc: vincent.guittot@linaro.org, ionela.voinescu@arm.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, 21cnbao@gmail.com, jonathan.cameron@huawei.com, linuxarm@huawei.com, prime.zeng@huawei.com, yangyicong@hisilicon.com Subject: Re: [PATCH] arch_topology: Make cluster topology span at least SMT CPUs Message-ID: <20220823092220.2p4tsq5rvmfk5ne4@bogus> References: <20220823073044.58697-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220823073044.58697-1-yangyicong@huawei.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,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 Tue, Aug 23, 2022 at 03:30:44PM +0800, Yicong Yang wrote: > From: Yicong Yang > > Currently cpu_clustergroup_mask() will return CPU mask if cluster span > more or the same CPUs as cpu_coregroup_mask(). This will result topology > borken on non-Cluster SMT machines. > > Test with: > qemu-system-aarch64 -enable-kvm -machine virt \ > -net none \ > -cpu host \ > -bios ./QEMU_EFI.fd \ > -m 2G \ > -smp 48,sockets=2,cores=12,threads=2 \ > -kernel $Image \ > -initrd $Rootfs \ > -nographic > -append "rdinit=init console=ttyAMA0 sched_verbose loglevel=8" > > We'll get below error: > [ 3.084568] BUG: arch topology borken > [ 3.084570] the SMT domain not a subset of the CLS domain > > Since cluster is a level higher than SMT, fix this by making cluster > spans at least SMT CPUs. > > Cc: Sudeep Holla Reviewed-by: Sudeep Holla > Cc: Vincent Guittot > Cc: Ionela Voinescu > Fixes: bfcc4397435d ("arch_topology: Limit span of cpu_clustergroup_mask()") > Signed-off-by: Yicong Yang > --- > drivers/base/arch_topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 0424b59b695e..0056a1273275 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -724,7 +724,7 @@ const struct cpumask *cpu_clustergroup_mask(int cpu) > */ > if (cpumask_subset(cpu_coregroup_mask(cpu), > &cpu_topology[cpu].cluster_sibling)) > - return get_cpu_mask(cpu); Sorry for this, for some reason I assumed the get_cpu_mask() will cover threads too. -- Regards, Sudeep