Message ID | 20231114040110.54590-5-yangyicong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1635328vqg; Mon, 13 Nov 2023 20:05:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IF155YlDgsnAd+AwsSGh4a3DHRPb2NPDsr5yaz3L54n6fdcweLCEtEdSS5XBZ7462A5Xteh X-Received: by 2002:a17:90b:4a0f:b0:283:551b:bd95 with SMTP id kk15-20020a17090b4a0f00b00283551bbd95mr2906449pjb.13.1699934706454; Mon, 13 Nov 2023 20:05:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699934706; cv=none; d=google.com; s=arc-20160816; b=bHLo8T8KXGJPyFg5EX4OQ1t/GJxwzEu42X72FNeiBly1I2YQmHWjBHaN16SNopa8fr 75jAaMwp1lX4OR9F8iCVGS4+XEVFPaOL0TMgyg38ZZ2O3pCsmiQHiIsICoIXXnDM+vLn WQ3X6Pr4TEl8XDxMWK2VkC7M+XRgXeKqt4zbqWgb3JmTe023T6hKAWLdfG12YuIEoPM5 tUQqe9SP9aPfNMwf0BiXOoQ3kQ3wOShNjJBsDZ6vWa+ejU7jnJzPqy8r2bu/JJ8UcvU1 eTW0KGNLsFwlQRE+HH5OBlVi/RdH1gH1VOAwgCHKfJCZVdrbWqxw8aatRrVeqtIhTDJ0 XQaw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OJ6IU2rp/j9zsTENmN84SYKsNmexyuQX+AHJQ+tsIjU=; fh=3iB9MPM7gOV8iaw6nlpksJFY47xoJvfTkJIkOXUlBK4=; b=VUXL9gX39ToRRaYRq2whdvZsy/BIkIMaF0HaeBuxHr26a7ARdKhMxEJlxpiAj8xA3K U23LqA6Hezu+RUA40d+LgTzAST4V40obtq79Kkxutlja6i91VvD7VeTI4xJHemlIaA/w jj9YQpUrHvSadBicehH4MtzNj6rtKJ5vHp1tjVwuhdZiQuMlQLwaq6c2lReTqOBCzQY0 W0MS/sEGXaY4XCKyezXQboe2np6n+wQOVVfzy6eqk9fsqdskEdceA2VPEZZ1vKyBWSV/ VJUPCKdaL8mk38Csfo0kZ17HsMc8vZIkdcGOyI8394sZmTmQr6LLNe7QEuMScpays0cD cPig== 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 z11-20020a17090acb0b00b0028054d20dadsi11780240pjt.95.2023.11.13.20.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 20:05:06 -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 5C30D809E8E6; Mon, 13 Nov 2023 20:05:04 -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 S232008AbjKNEEl (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Mon, 13 Nov 2023 23:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjKNEEb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Nov 2023 23:04:31 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C11DD44 for <linux-kernel@vger.kernel.org>; Mon, 13 Nov 2023 20:04:26 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4STsxx6GSyzMmPP; Tue, 14 Nov 2023 11:59:49 +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:24 +0800 From: Yicong Yang <yangyicong@huawei.com> To: <catalin.marinas@arm.com>, <will@kernel.org>, <sudeep.holla@arm.com>, <linux-arm-kernel@lists.infradead.org> CC: <dietmar.eggemann@arm.com>, <gregkh@linuxfoundation.org>, <rafael@kernel.org>, <jonathan.cameron@huawei.com>, <prime.zeng@hisilicon.com>, <linuxarm@huawei.com>, <yangyicong@hisilicon.com>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 4/4] arm64: Kconfig: Enable HOTPLUG_SMT Date: Tue, 14 Nov 2023 12:01:10 +0800 Message-ID: <20231114040110.54590-5-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20231114040110.54590-1-yangyicong@huawei.com> References: <20231114040110.54590-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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: <linux-kernel.vger.kernel.org> 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:05:04 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782510734485603816 X-GMAIL-MSGID: 1782510734485603816 |
Series | Support SMT control on arm64 | |
Commit Message
Yicong Yang
Nov. 14, 2023, 4:01 a.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com> Enable HOTPLUG_SMT for SMT control. Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+)
Comments
Hi Yicong,
kernel test robot noticed the following build errors:
[auto build test ERROR on arm64/for-next/core]
[also build test ERROR on driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus arm/for-next kvmarm/next soc/for-next linus/master arm/fixes v6.7-rc1 next-20231115]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Yicong-Yang/arch_topology-Support-basic-SMT-control-for-the-driver/20231114-120544
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
patch link: https://lore.kernel.org/r/20231114040110.54590-5-yangyicong%40huawei.com
patch subject: [PATCH v3 4/4] arm64: Kconfig: Enable HOTPLUG_SMT
config: arm64-randconfig-002-20231115 (https://download.01.org/0day-ci/archive/20231115/202311151900.K9xc6Xqz-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231115/202311151900.K9xc6Xqz-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <yujie.liu@intel.com>
| Closes: https://lore.kernel.org/r/202311151900.K9xc6Xqz-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/cpu.c: In function 'cpuhp_smt_disable':
>> kernel/cpu.c:2687:23: error: implicit declaration of function 'cpu_down_maps_locked' [-Werror=implicit-function-declaration]
2687 | ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/cpu_down_maps_locked +2687 kernel/cpu.c
dc8d37ed304eee Arnd Bergmann 2019-12-10 2672
dc8d37ed304eee Arnd Bergmann 2019-12-10 2673 int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
dc8d37ed304eee Arnd Bergmann 2019-12-10 2674 {
dc8d37ed304eee Arnd Bergmann 2019-12-10 2675 int cpu, ret = 0;
dc8d37ed304eee Arnd Bergmann 2019-12-10 2676
dc8d37ed304eee Arnd Bergmann 2019-12-10 2677 cpu_maps_update_begin();
dc8d37ed304eee Arnd Bergmann 2019-12-10 2678 for_each_online_cpu(cpu) {
dc8d37ed304eee Arnd Bergmann 2019-12-10 2679 if (topology_is_primary_thread(cpu))
dc8d37ed304eee Arnd Bergmann 2019-12-10 2680 continue;
38253464bc821d Michael Ellerman 2023-07-05 2681 /*
38253464bc821d Michael Ellerman 2023-07-05 2682 * Disable can be called with CPU_SMT_ENABLED when changing
38253464bc821d Michael Ellerman 2023-07-05 2683 * from a higher to lower number of SMT threads per core.
38253464bc821d Michael Ellerman 2023-07-05 2684 */
38253464bc821d Michael Ellerman 2023-07-05 2685 if (ctrlval == CPU_SMT_ENABLED && cpu_smt_thread_allowed(cpu))
38253464bc821d Michael Ellerman 2023-07-05 2686 continue;
dc8d37ed304eee Arnd Bergmann 2019-12-10 @2687 ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
dc8d37ed304eee Arnd Bergmann 2019-12-10 2688 if (ret)
dc8d37ed304eee Arnd Bergmann 2019-12-10 2689 break;
dc8d37ed304eee Arnd Bergmann 2019-12-10 2690 /*
dc8d37ed304eee Arnd Bergmann 2019-12-10 2691 * As this needs to hold the cpu maps lock it's impossible
dc8d37ed304eee Arnd Bergmann 2019-12-10 2692 * to call device_offline() because that ends up calling
dc8d37ed304eee Arnd Bergmann 2019-12-10 2693 * cpu_down() which takes cpu maps lock. cpu maps lock
dc8d37ed304eee Arnd Bergmann 2019-12-10 2694 * needs to be held as this might race against in kernel
dc8d37ed304eee Arnd Bergmann 2019-12-10 2695 * abusers of the hotplug machinery (thermal management).
dc8d37ed304eee Arnd Bergmann 2019-12-10 2696 *
dc8d37ed304eee Arnd Bergmann 2019-12-10 2697 * So nothing would update device:offline state. That would
dc8d37ed304eee Arnd Bergmann 2019-12-10 2698 * leave the sysfs entry stale and prevent onlining after
dc8d37ed304eee Arnd Bergmann 2019-12-10 2699 * smt control has been changed to 'off' again. This is
dc8d37ed304eee Arnd Bergmann 2019-12-10 2700 * called under the sysfs hotplug lock, so it is properly
dc8d37ed304eee Arnd Bergmann 2019-12-10 2701 * serialized against the regular offline usage.
dc8d37ed304eee Arnd Bergmann 2019-12-10 2702 */
dc8d37ed304eee Arnd Bergmann 2019-12-10 2703 cpuhp_offline_cpu_device(cpu);
dc8d37ed304eee Arnd Bergmann 2019-12-10 2704 }
dc8d37ed304eee Arnd Bergmann 2019-12-10 2705 if (!ret)
dc8d37ed304eee Arnd Bergmann 2019-12-10 2706 cpu_smt_control = ctrlval;
dc8d37ed304eee Arnd Bergmann 2019-12-10 2707 cpu_maps_update_done();
dc8d37ed304eee Arnd Bergmann 2019-12-10 2708 return ret;
dc8d37ed304eee Arnd Bergmann 2019-12-10 2709 }
dc8d37ed304eee Arnd Bergmann 2019-12-10 2710
On 2023/11/16 12:59, kernel test robot wrote: > Hi Yicong, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on arm64/for-next/core] > [also build test ERROR on driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus arm/for-next kvmarm/next soc/for-next linus/master arm/fixes v6.7-rc1 next-20231115] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Yicong-Yang/arch_topology-Support-basic-SMT-control-for-the-driver/20231114-120544 > base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core > patch link: https://lore.kernel.org/r/20231114040110.54590-5-yangyicong%40huawei.com > patch subject: [PATCH v3 4/4] arm64: Kconfig: Enable HOTPLUG_SMT > config: arm64-randconfig-002-20231115 (https://download.01.org/0day-ci/archive/20231115/202311151900.K9xc6Xqz-lkp@intel.com/config) > compiler: aarch64-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231115/202311151900.K9xc6Xqz-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <yujie.liu@intel.com> > | Closes: https://lore.kernel.org/r/202311151900.K9xc6Xqz-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > kernel/cpu.c: In function 'cpuhp_smt_disable': >>> kernel/cpu.c:2687:23: error: implicit declaration of function 'cpu_down_maps_locked' [-Werror=implicit-function-declaration] > 2687 | ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); > | ^~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > cpu_down_maps_locked() is introduced by CONFIG_HOTPLUG_CPU, so CONFIG_HOTPLUG_SMT will need to depend on CONFIG_HOTPLUG_CPU. Will add it. > > vim +/cpu_down_maps_locked +2687 kernel/cpu.c > > dc8d37ed304eee Arnd Bergmann 2019-12-10 2672 > dc8d37ed304eee Arnd Bergmann 2019-12-10 2673 int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) > dc8d37ed304eee Arnd Bergmann 2019-12-10 2674 { > dc8d37ed304eee Arnd Bergmann 2019-12-10 2675 int cpu, ret = 0; > dc8d37ed304eee Arnd Bergmann 2019-12-10 2676 > dc8d37ed304eee Arnd Bergmann 2019-12-10 2677 cpu_maps_update_begin(); > dc8d37ed304eee Arnd Bergmann 2019-12-10 2678 for_each_online_cpu(cpu) { > dc8d37ed304eee Arnd Bergmann 2019-12-10 2679 if (topology_is_primary_thread(cpu)) > dc8d37ed304eee Arnd Bergmann 2019-12-10 2680 continue; > 38253464bc821d Michael Ellerman 2023-07-05 2681 /* > 38253464bc821d Michael Ellerman 2023-07-05 2682 * Disable can be called with CPU_SMT_ENABLED when changing > 38253464bc821d Michael Ellerman 2023-07-05 2683 * from a higher to lower number of SMT threads per core. > 38253464bc821d Michael Ellerman 2023-07-05 2684 */ > 38253464bc821d Michael Ellerman 2023-07-05 2685 if (ctrlval == CPU_SMT_ENABLED && cpu_smt_thread_allowed(cpu)) > 38253464bc821d Michael Ellerman 2023-07-05 2686 continue; > dc8d37ed304eee Arnd Bergmann 2019-12-10 @2687 ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); > dc8d37ed304eee Arnd Bergmann 2019-12-10 2688 if (ret) > dc8d37ed304eee Arnd Bergmann 2019-12-10 2689 break; > dc8d37ed304eee Arnd Bergmann 2019-12-10 2690 /* > dc8d37ed304eee Arnd Bergmann 2019-12-10 2691 * As this needs to hold the cpu maps lock it's impossible > dc8d37ed304eee Arnd Bergmann 2019-12-10 2692 * to call device_offline() because that ends up calling > dc8d37ed304eee Arnd Bergmann 2019-12-10 2693 * cpu_down() which takes cpu maps lock. cpu maps lock > dc8d37ed304eee Arnd Bergmann 2019-12-10 2694 * needs to be held as this might race against in kernel > dc8d37ed304eee Arnd Bergmann 2019-12-10 2695 * abusers of the hotplug machinery (thermal management). > dc8d37ed304eee Arnd Bergmann 2019-12-10 2696 * > dc8d37ed304eee Arnd Bergmann 2019-12-10 2697 * So nothing would update device:offline state. That would > dc8d37ed304eee Arnd Bergmann 2019-12-10 2698 * leave the sysfs entry stale and prevent onlining after > dc8d37ed304eee Arnd Bergmann 2019-12-10 2699 * smt control has been changed to 'off' again. This is > dc8d37ed304eee Arnd Bergmann 2019-12-10 2700 * called under the sysfs hotplug lock, so it is properly > dc8d37ed304eee Arnd Bergmann 2019-12-10 2701 * serialized against the regular offline usage. > dc8d37ed304eee Arnd Bergmann 2019-12-10 2702 */ > dc8d37ed304eee Arnd Bergmann 2019-12-10 2703 cpuhp_offline_cpu_device(cpu); > dc8d37ed304eee Arnd Bergmann 2019-12-10 2704 } > dc8d37ed304eee Arnd Bergmann 2019-12-10 2705 if (!ret) > dc8d37ed304eee Arnd Bergmann 2019-12-10 2706 cpu_smt_control = ctrlval; > dc8d37ed304eee Arnd Bergmann 2019-12-10 2707 cpu_maps_update_done(); > dc8d37ed304eee Arnd Bergmann 2019-12-10 2708 return ret; > dc8d37ed304eee Arnd Bergmann 2019-12-10 2709 } > dc8d37ed304eee Arnd Bergmann 2019-12-10 2710 >
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7b071a00425d..002bcde32575 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -233,6 +233,7 @@ config ARM64 select HAVE_KRETPROBES select HAVE_GENERIC_VDSO select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU + select HOTPLUG_SMT if SMP select IRQ_DOMAIN select IRQ_FORCED_THREADING select KASAN_VMALLOC if KASAN