Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2625715rdb; Fri, 22 Sep 2023 04:24:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSpsHni/RS82tP2AM+XUSSaIpR9yBpbMhycREwHS6AOBGYS5DsdHsuEO4spyzMCxyhH+bp X-Received: by 2002:aa7:8894:0:b0:68f:c261:ddfe with SMTP id z20-20020aa78894000000b0068fc261ddfemr8674179pfe.28.1695381885792; Fri, 22 Sep 2023 04:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695381885; cv=none; d=google.com; s=arc-20160816; b=QWi70oLFii2LS1W1WLLHGqPPpjNEysMDPkyh980ICWMIY8+wZqKBj/4GPsWZr+3OgH pv/65xHMGgK9+xfBJnd3UMEar8M18zxmvkQ/Eyf1OWxqOqDwfNX7qS2rCv2Tz3DMq6Fv lTlRGubw9dM+Ej9fycJhhwFQVCDzA+KVMudIMNuEmr+NeBDLxpK6HuUbeLJUFgZNsJJB LcQwzWmTcwQSXgm6SzjZxsYGZb8ebjym/tARRAPulhNUyGUFRmGJaFcmUtcmLBm2pVlW 3hTHsw8qRpSR6Rre5Vw5GcONVqZ7dNcYVtFTEvKv5gcNtLRJ0mRRQ00mpVjUU2eUYf1m cA/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=1n/wcmmXq+2Zb30E5WNStch0Qc3PDaPVh4MrU9KoFug=; fh=jLuHn+0creAhXsM8PlJYNdnFAbJxPj7kQLSa/wKdtjY=; b=nMGrw5WP3z408b5OQsNQoaE7Z3ze6pXNm19oTMAR6rZDORwsaUlomkpp+oTzSct4zr SYDC4LnKRXb/fBu6gSsSxO33L3kqDIDBLdjQxcoqg7BdzTUpFb1Wk1DTDkJzjXvdtNpY 8qCFDqTFPk0+6hCnw4nA9bnuV2hcGwPP2RISMpWvG6CNJHDOXbbUWfBlTWBOy/7kVgp6 cq3YPN9eCJ2NCnTmnTXQkMGfVGyNHDFBQhcronOg2l6FbltZcUuW2u7V358y7fTS8tAi 21+DK4R1Cu2riECNq0JEY3oqpXgt2oFvwvl19xJ3E/WqsdQ9b4xX140rcIa/5B59bdNJ 0Nkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cw24-20020a056a00451800b00690b8b03454si3569076pfb.234.2023.09.22.04.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 04:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4DC4C805E43C; Fri, 22 Sep 2023 04:14:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233546AbjIVLN6 (ORCPT + 99 others); Fri, 22 Sep 2023 07:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233537AbjIVLNy (ORCPT ); Fri, 22 Sep 2023 07:13:54 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9906AF for ; Fri, 22 Sep 2023 04:13:48 -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 9D5A6DA7; Fri, 22 Sep 2023 04:14:25 -0700 (PDT) Received: from [192.168.178.106] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 43AC23F5A1; Fri, 22 Sep 2023 04:13:45 -0700 (PDT) Message-ID: <2247ced8-c4f9-80a7-a0a2-0953abed135f@arm.com> Date: Fri, 22 Sep 2023 13:13:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] arch_topology: Support SMT control on arm64 Content-Language: en-US To: Yicong Yang , catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org Cc: yangyicong@hisilicon.com, gregkh@linuxfoundation.org, rafael@kernel.org, jonathan.cameron@huawei.com, prime.zeng@hisilicon.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org References: <20230919123319.23785-1-yangyicong@huawei.com> <130ce530-a3c1-0918-e04f-cb7d94aef57b@arm.com> <80b2556c-b56c-ca23-22c7-70a0a3995701@huawei.com> From: Dietmar Eggemann In-Reply-To: <80b2556c-b56c-ca23-22c7-70a0a3995701@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 04:14:00 -0700 (PDT) On 21/09/2023 10:56, Yicong Yang wrote: > On 2023/9/21 1:08, Dietmar Eggemann wrote: >> On 19/09/2023 14:33, Yicong Yang wrote: >>> From: Yicong Yang [...] > If you manually disable SMT by offline each CPUs the cpu_smt_control will > not be updated. It'll updated when using the interface like > `/sys/devices/system/cpu/smt/control` or cmdline. By these means, > the framework will use topology_is_primary_thread() to decide which CPU > in the SMT will keep online: > > // e.g. echo off > /sys/devices/system/cpu/smt/control > [ kernel/cpu.c ] > control_store() > __store_smt_control() > cpuhp_smt_disable() > for_each_online_cpu(cpu) > if (topology_is_primary_thread(cpu)) > continue; <---------- will skip the primary thread > [...] > cpu_smt_control = CPU_SMT_DISABLED; > > topology_is_primary_thread() checking only applies to the SMT control but > not to the CPU offline. I see, make sense. Retested on my SMT4 Arm64 server with 256 CPUs.