Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2732200ioo; Tue, 24 May 2022 04:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKCvSwk1ipd8q9j7sbr+gCKpF6TYoC4scwMUJJ/10dde5mNlFHTmsxkxwrKDt7rXS9JtIy X-Received: by 2002:a05:6a00:10cc:b0:505:ada6:e03e with SMTP id d12-20020a056a0010cc00b00505ada6e03emr28236340pfu.45.1653393272622; Tue, 24 May 2022 04:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653393272; cv=none; d=google.com; s=arc-20160816; b=ohFxpdyNjfeH5DtkGdNwLaZEk/2ybLJ41HqyMsx8+RyU6b1adyR2m229V9bgHZzpKI V+mnc0yD5ZHbKLtjaMdvy43Lkee3T5mpx9sjQ/KZWopjJ3MdNy/PsVUz4sayc5CXDqre DflAuxCMzSCSb2FyEQgfv+5sLLpTOP0+ly92BhylPY3gtGvb8F45fRvZ6oA5YWxFaqoT U+hNAh62EGDbsyXfQQOsjx/GmYuyWsXgm2UAXE3z2r8LN+Fo0bKun0poRLzfv30n42F7 hi//jjuZEaZESxoeb0GoGTDeAv3k7lbjxEdY0E+3I9izbqVhpmSE87g2XQWgIhIWzTaj RW2g== 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=ktXUYqlrt5D/aLdgP/O1ccWcQ2eIkZbEwVfZZVPV+oI=; b=p/YKKZrKyUmWAWelyonuA2lXgECiwoISb4HgztO5R7m9XIfmhyoLme6x268qiHAWmI 8BUiCaPqlJ19Tm0u1mVhxDEuAZUqLz2rCR6rPThMRhy4fgC5KUjLQXV5UQji+jNq2oVV 8LGFDeOd10/yuRkakDUehjWfzXmUulOBQxOv0gfhHZZB1xX6Bb/66q++BAu+71puGKL3 YPWy4Xa0tT+7WWYYwMrw5buy/t2T4MDwz9F5lLUWEHUe08UN7ji3sE1YcjZAkWiuslUi uwOkJlLxlg0V/nOZ7krZ4ACbU9VvtrbR5aHB6CZFH6jUqDJLh3yqIQOGzwVHDvBDmAaQ ptQw== 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 f189-20020a636ac6000000b003fa60807a34si7254108pgc.94.2022.05.24.04.54.20; Tue, 24 May 2022 04:54:32 -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 S233460AbiEXIwK (ORCPT + 99 others); Tue, 24 May 2022 04:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233331AbiEXIwH (ORCPT ); Tue, 24 May 2022 04:52:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7130469B40 for ; Tue, 24 May 2022 01:52:06 -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 2FB2A1FB; Tue, 24 May 2022 01:52:06 -0700 (PDT) Received: from bogus (unknown [10.57.66.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 34B4E3F73D; Tue, 24 May 2022 01:52:04 -0700 (PDT) Date: Tue, 24 May 2022 09:51:57 +0100 From: Sudeep Holla To: Gavin Shan Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rafael@kernel.org, Jonathan.Cameron@huawei.com, drjones@redhat.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH] arch_topology: Limit threads to one specific cluster Message-ID: <20220524085157.o3ie6hjy3tg5of5y@bogus> References: <20220524081212.1363105-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220524081212.1363105-1-gshan@redhat.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, 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 Tue, May 24, 2022 at 04:12:12PM +0800, Gavin Shan wrote: > The sibling information for one particular CPU is updated after ACPI > PPTT table is parsed. struct cpu_topology::thread_sibling tracks the > the CPUs in same core. However, cluster isn't considered when it's > populated. In this case, multiple threads belonging to different > clusters can be put together through the sibling information. It > eventually leads to unexpected warning from sched subsystem. > > For example, the following warning is observed in a VM where we have > 2 sockets, 4 clusters, 8 cores and 16 threads and the CPU topology > is populated as below. > > CPU Socket-ID Cluster-ID Core-ID Thread-ID > ---------------------------------------------- > 0 0 0 0 0 > 1 0 0 0 1 > 2 0 0 1 0 > 3 0 0 1 1 > 4 0 1 0 0 > 5 0 1 0 1 > 6 0 1 1 0 > 7 0 1 1 1 > 8 1 0 0 0 > 9 1 0 0 1 > 10 1 0 1 0 > 11 1 0 1 1 > 12 1 1 0 0 > 13 1 1 0 1 > 14 1 1 1 0 > 15 1 1 1 1 > > [ 0.592181] CPU: All CPU(s) started at EL1 > [ 0.593766] alternatives: patching kernel code > [ 0.595890] BUG: arch topology borken > [ 0.597210] the SMT domain not a subset of the CLS domain > [ 0.599286] child=0-1,4-5 sd=0-3 > > # cat /sys/devices/system/cpu/cpu0/topology/cluster_cpus_list > 0-3 > # cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list > 0-1,4-5 > > This fixes the issue by limiting threads to one specific cluster. > With this applied, the unexpected warning disappears in the VM. > I have similar fix but as part of bigger series[1] to get DT support in line with ACPI. -- Regards, Sudeep [1] https://lore.kernel.org/lkml/20220518093325.2070336-3-sudeep.holla@arm.com