Message ID | 20241030125415.18994-1-yangyicong@huawei.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linuxppc-dev+bounces-2722-incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev+bounces-2722-incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XdnCY4l5Rz1xwK for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 23:55:05 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4XdnCP5xTWz2yfm; Wed, 30 Oct 2024 23:54:57 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730292897; cv=none; b=d7rRG3fc/pL+0UmmPSdIsx7sRD4Tl4b37n6hiPNjIKfRDB5H8PmhopHRtdlfsvesKs01JX2WzRGjqmH7aXhL/szZsfFxgkYllA/qb2pKAaoaOuv7fRNgYX6gVWAE0lB9Ii9CmZqGTlHX0eel14N2bkWd1KFsiKBH4ruEAiZgLG9IbFYfcd2i0yhrfxw8+DgmzTe8qFYj2AveUj1BgAIVMN4xgLUxNWzg5vXOwtQtIMKRudRsffdEsVUAMZk4xtj5JbU19tD2QjK2OX+nbnotKBpLYZ78bm4OA1B6OioTS+lTTzxgkbWjSyCFZ0MpEqcg0jXeDcS7gQ5pQ/Wzhf8YNg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1730292897; c=relaxed/relaxed; bh=9bRqsi6atK4ThDmegogm9bRXC2CzUQhrRy1y3ziSy/4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AGqH2gGpYPeYh0jrXALRV/Ws1EgyNJlyuXxWAk+4uJ7xb4ikLVojYwseWz2hdrF5hCwUT8ygfp3B82A0hLCcSga/9PM/aHM/OhkoHDTfWRvZi+AnhPsiXIfYCgmm2Xffj7ur1NAkNX6UUTCFhh+NsEBSz/q+fdwZG99DFKyn96cIyh/d/5K8g7U5Qjdl5UJcxFZNo0/ki/OZ0ONuJOlHfPIhRW24W8TDQlTo/LAvFSUQKI9El5JWMiTKVuUoKUyyt726aLwxTwvOg5FDhIbLNfANhUTgAiGqKTxR1xLGJf6NvtLevQ7VyiXDyXkrKwx9rvhwFCpRVbROzAYSUy/Hxw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=45.249.212.255; helo=szxga08-in.huawei.com; envelope-from=yangyicong@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=45.249.212.255; helo=szxga08-in.huawei.com; envelope-from=yangyicong@huawei.com; receiver=lists.ozlabs.org) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4XdnCM4lczz2yMF for <linuxppc-dev@lists.ozlabs.org>; Wed, 30 Oct 2024 23:54:52 +1100 (AEDT) Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Xdn8d686Kz1T97h; Wed, 30 Oct 2024 20:52:33 +0800 (CST) Received: from kwepemd200014.china.huawei.com (unknown [7.221.188.8]) by mail.maildlp.com (Postfix) with ESMTPS id C3299180064; Wed, 30 Oct 2024 20:54:44 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by kwepemd200014.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Wed, 30 Oct 2024 20:54:43 +0800 From: Yicong Yang <yangyicong@huawei.com> To: <catalin.marinas@arm.com>, <will@kernel.org>, <sudeep.holla@arm.com>, <tglx@linutronix.de>, <peterz@infradead.org>, <mpe@ellerman.id.au>, <linux-arm-kernel@lists.infradead.org>, <mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>, <pierre.gondois@arm.com>, <dietmar.eggemann@arm.com> CC: <linuxppc-dev@lists.ozlabs.org>, <x86@kernel.org>, <linux-kernel@vger.kernel.org>, <morten.rasmussen@arm.com>, <msuchanek@suse.de>, <gregkh@linuxfoundation.org>, <rafael@kernel.org>, <jonathan.cameron@huawei.com>, <prime.zeng@hisilicon.com>, <linuxarm@huawei.com>, <yangyicong@hisilicon.com>, <xuwei5@huawei.com>, <guohanjun@huawei.com> Subject: [PATCH v7 0/4] Support SMT control on arm64 Date: Wed, 30 Oct 2024 20:54:11 +0800 Message-ID: <20241030125415.18994-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: <linuxppc-dev.lists.ozlabs.org> List-Help: <mailto:linuxppc-dev+help@lists.ozlabs.org> List-Owner: <mailto:linuxppc-dev+owner@lists.ozlabs.org> List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> List-Archive: <https://lore.kernel.org/linuxppc-dev/>, <https://lists.ozlabs.org/pipermail/linuxppc-dev/> List-Subscribe: <mailto:linuxppc-dev+subscribe@lists.ozlabs.org>, <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>, <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org> List-Unsubscribe: <mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd200014.china.huawei.com (7.221.188.8) X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on lists.ozlabs.org |
Series | Support SMT control on arm64 | expand |
From: Yicong Yang <yangyicong@hisilicon.com> The core CPU control framework supports runtime SMT control which is not yet supported on arm64. Besides the general vulnerabilities concerns we want this runtime control on our arm64 server for: - better single CPU performance in some cases - saving overall power consumption This patchset implements it in the following aspects: - Provides a default topology_is_primary_thread() - support retrieve SMT thread number on OF based system - support retrieve SMT thread number on ACPI based system - select HOTPLUG_SMT for arm64 Tests has been done on our real ACPI based arm64 server and on ACPI/OF based QEMU VMs. Change since v6: - Fix unused variable if !CONFIG_ARM64 || !CONFIG_RISV found by lkp-test - Fix max_smt_thread_num updating in OF path pointed by Pierre - Drop unused variable and refine the comments/commit per Pierre Link: https://lore.kernel.org/linux-arm-kernel/20241015021841.35713-1-yangyicong@huawei.com/ Change since v5: - Drop the dependency on CONFIG_SMP since it's always on on arm64, per Pierre - Avoid potential multiple calls of cpu_smt_set_num_threads() on asymmetric system, per Dietmar - Detect heterogenous SMT topology and issue a warning for partly support, per Pierre - Thanks Dietmar for testing, didn't pickup the tag due to code changes. Thanks testing by Pierre Link: https://lore.kernel.org/linux-arm-kernel/20240806085320.63514-1-yangyicong@huawei.com/ Change since v4: - Provide a default topology_is_primary_thread() in the framework, Per Will Link: https://lore.kernel.org/linux-arm-kernel/20231121092602.47792-1-yangyicong@huawei.com/ Change since v3: - Fix some build and kconfig error reported by kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/linux-arm-kernel/20231114040110.54590-1-yangyicong@huawei.com/ Change since v2: - Detect SMT thread number at topology build from ACPI/DT, avoid looping CPUs - Split patches into ACPI/OF/arch_topology path and enable the kconfig for arm64 Link: https://lore.kernel.org/linux-arm-kernel/20231010115335.13862-1-yangyicong@huawei.com/ Yicong Yang (4): cpu/SMT: Provide a default topology_is_primary_thread() arch_topology: Support SMT control for OF based system arm64: topology: Support SMT control on ACPI based system arm64: Kconfig: Enable HOTPLUG_SMT arch/arm64/Kconfig | 1 + arch/arm64/kernel/topology.c | 57 +++++++++++++++++++++++++++++ arch/powerpc/include/asm/topology.h | 1 + arch/x86/include/asm/topology.h | 2 +- drivers/base/arch_topology.c | 24 ++++++++++++ include/linux/topology.h | 14 +++++++ 6 files changed, 98 insertions(+), 1 deletion(-)