From patchwork Tue Nov 14 04:01:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 16538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1635281vqg; Mon, 13 Nov 2023 20:04:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGccJ3v5zo2OPr1pj6ZnNlVIGFa1EawVgeIxQzpF0L0qbIlsQFWyZOJNm7Z8YyJkxA3Fw5i X-Received: by 2002:a05:6e02:b4c:b0:358:cf4:4fc5 with SMTP id f12-20020a056e020b4c00b003580cf44fc5mr11993200ilu.25.1699934699473; Mon, 13 Nov 2023 20:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699934699; cv=none; d=google.com; s=arc-20160816; b=D1jPQO3I8tGVd6nmYNiLURrLZJj/UhU+xW2Zd+LwDbnecGQC9bAzRLZdDxe2eRYJSf GQ4EWIqJytyK3ErStbD5kRAgMlvNI+NVXaYyxmOIQl0+iQVLzJUGZApbmELEfyWc/0YF 3mzthpntIyDo4o6TpyuddRn1YeZoPOVGGrCYDjoLeid5c2lVOvhXyhDVTqzWWt62UwHX i0xW4OBYKdp+xZNPe9XXV2pItnmwce0oxxiRS/SVJdGhPcKN2KjvHA3+dGOEFr08TSGa i7R7GzDSQtPIETxEjM9637rmQBDJT1dhxEh97w3ld1uidpfN+v83DBb9V3U0dAeco2Ph MscQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Hnb2ePgwExVvMmgl7niQdbPA3pJyLvAVQuV/7jX+lF4=; fh=3iB9MPM7gOV8iaw6nlpksJFY47xoJvfTkJIkOXUlBK4=; b=XYdri05xd5MZs5XQQoW4cOZJxtQJx80aNupz4Uom5HPLrspmNWn88VCqfpULcS+9Ne H1TMtG6W7wLEZCaRprWXnrsYNtoyb0IDNRzttClcIkbL74090Cp4SNinz9QY+CNJIX45 fB93BSGOjTQY2EKATjqkFGXIjfx01+Ft+jxILx27O5CVR/+jTUQp1C/dhlKydmafkWZM NaP46qZHNiV/Xd3kjj94V7rM9je1P1zqiz0jBRntoflxaGNvhYAH50unuC6C1kX96gPQ CwbAfy0VV8jlUCMVtx/FTuu/geFIRNghxCnk6pOznnTzHdSbKNUxyxCPltlC9nP48l0a OWHg== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 128-20020a630186000000b005c1754b3d4fsi5320345pgb.159.2023.11.13.20.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 20:04:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A8DCB80B26F0; Mon, 13 Nov 2023 20:04:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbjKNEEe (ORCPT + 30 others); Mon, 13 Nov 2023 23:04:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjKNEEa (ORCPT ); Mon, 13 Nov 2023 23:04:30 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A51CD42 for ; Mon, 13 Nov 2023 20:04:26 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4STszP4LPsz1P8JJ; Tue, 14 Nov 2023 12:01:05 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 14 Nov 2023 12:04:23 +0800 From: Yicong Yang To: , , , CC: , , , , , , , Subject: [PATCH v3 0/4] Support SMT control on arm64 Date: Tue, 14 Nov 2023 12:01:06 +0800 Message-ID: <20231114040110.54590-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 13 Nov 2023 20:04:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782510727063983638 X-GMAIL-MSGID: 1782510727063983638 From: Yicong Yang 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: - implements the basic support in arch_topology driver - 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. The patchset is based on v6.7-rc1. 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): arch_topology: Support basic SMT control for the driver 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 | 23 +++++++++++++++++++++ drivers/base/arch_topology.c | 39 +++++++++++++++++++++++++++++++++++ include/linux/arch_topology.h | 9 ++++++++ 4 files changed, 72 insertions(+)