From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752919AbcGTB06 (ORCPT ); Tue, 19 Jul 2016 21:26:58 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:29226 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752311AbcGTB0y (ORCPT ); Tue, 19 Jul 2016 21:26:54 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="8881533" Subject: Re: [PATCH v8 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting. To: "Rafael J. Wysocki" References: <1468913288-16605-1-git-send-email-douly.fnst@cn.fujitsu.com> <1468913288-16605-6-git-send-email-douly.fnst@cn.fujitsu.com> <1699870.UOpnC170VZ@vostro.rjw.lan> CC: , , , , , , , , , , , , , , , , , , , , Gu Zheng , Tang Chen , Zhu Guihua From: Dou Liyang Message-ID: <703372c8-82fc-7d2e-75ad-e43cb1fb8c5e@cn.fujitsu.com> Date: Wed, 20 Jul 2016 09:25:13 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1699870.UOpnC170VZ@vostro.rjw.lan> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 7C0564290FE0.AAF36 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016年07月20日 04:06, Rafael J. Wysocki 写道: > On Tuesday, July 19, 2016 03:28:06 PM Dou Liyang wrote: >> From: Gu Zheng >> >> The whole patch-set aims at making cpuid <-> nodeid mapping persistent. So that, >> when node online/offline happens, cache based on cpuid <-> nodeid mapping such as >> wq_numa_possible_cpumask will not cause any problem. >> It contains 4 steps: >> 1. Enable apic registeration flow to handle both enabled and disabled cpus. >> 2. Introduce a new array storing all possible cpuid <-> apicid mapping. >> 3. Enable _MAT and MADT relative apis to return non-presnet or disabled cpus' apicid. >> 4. Establish all possible cpuid <-> nodeid mapping. >> >> This patch finishes step 4. >> >> This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled >> processors at boot time via an additional acpi namespace walk for processors. >> >> Signed-off-by: Gu Zheng >> Signed-off-by: Tang Chen >> Signed-off-by: Zhu Guihua >> Signed-off-by: Dou Liyang >> --- >> arch/ia64/kernel/acpi.c | 3 +- >> arch/x86/kernel/acpi/boot.c | 4 ++- >> drivers/acpi/acpi_processor.c | 5 ++++ >> drivers/acpi/bus.c | 3 ++ >> drivers/acpi/processor_core.c | 65 +++++++++++++++++++++++++++++++++++++++++++ >> include/linux/acpi.h | 2 ++ >> 6 files changed, 80 insertions(+), 2 deletions(-) >> >> diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c >> index b1698bc..bb36515 100644 >> --- a/arch/ia64/kernel/acpi.c >> +++ b/arch/ia64/kernel/acpi.c >> @@ -796,7 +796,7 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) >> * ACPI based hotplug CPU support >> */ >> #ifdef CONFIG_ACPI_HOTPLUG_CPU >> -static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> +int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> { >> #ifdef CONFIG_ACPI_NUMA >> /* >> @@ -811,6 +811,7 @@ static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> #endif >> return 0; >> } >> +EXPORT_SYMBOL(acpi_map_cpu2node); >> >> int additional_cpus __initdata = -1; >> >> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c >> index 37248c3..0900264f 100644 >> --- a/arch/x86/kernel/acpi/boot.c >> +++ b/arch/x86/kernel/acpi/boot.c >> @@ -695,7 +695,7 @@ static void __init acpi_set_irq_model_ioapic(void) >> #ifdef CONFIG_ACPI_HOTPLUG_CPU >> #include >> >> -static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> +int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> { >> #ifdef CONFIG_ACPI_NUMA >> int nid; >> @@ -706,7 +706,9 @@ static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> numa_set_node(cpu, nid); >> } >> #endif >> + return 0; >> } >> +EXPORT_SYMBOL(acpi_map_cpu2node); >> >> int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu) >> { >> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c >> index e85b19a..0c15828 100644 >> --- a/drivers/acpi/acpi_processor.c >> +++ b/drivers/acpi/acpi_processor.c >> @@ -182,6 +182,11 @@ int __weak arch_register_cpu(int cpu) >> >> void __weak arch_unregister_cpu(int cpu) {} >> >> +int __weak acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) >> +{ >> + return -ENODEV; >> +} >> + >> static int acpi_processor_hotadd_init(struct acpi_processor *pr) >> { >> unsigned long long sta; >> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c >> index 262ca31..d8b7272 100644 >> --- a/drivers/acpi/bus.c >> +++ b/drivers/acpi/bus.c >> @@ -1124,6 +1124,9 @@ static int __init acpi_init(void) >> acpi_sleep_proc_init(); >> acpi_wakeup_device_init(); >> acpi_debugger_init(); >> +#ifdef CONFIG_ACPI_HOTPLUG_CPU >> + acpi_set_processor_mapping(); >> +#endif > This doesn't look nice. > > What about providing an empty definition of acpi_set_processor_mapping() > for CONFIG_ACPI_HOTPLUG_CPU unset? Good, I will do it. Thanks, Dou > >> return 0; >> } > Thanks, > Rafael > > >