From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934106AbcIVDEc (ORCPT ); Wed, 21 Sep 2016 23:04:32 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:47183 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932741AbcIVDE3 (ORCPT ); Wed, 21 Sep 2016 23:04:29 -0400 Subject: Re: [PATCH] arm64: Call numa_store_cpu_info() earlier. To: David Daney , , "Marc Zyngier" , Hanjun Guo , "Will Deacon" , Ganapatrao Kulkarni , Catalin Marinas , Mark Rutland , Suzuki K Poulose References: <1474397195-16520-1-git-send-email-ddaney.cavm@gmail.com> CC: Robert Richter , , David Daney From: Yisheng Xie Message-ID: <20bc1c5f-7e8f-a18c-0061-24d97b3a62fe@huawei.com> Date: Thu, 22 Sep 2016 11:04:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1474397195-16520-1-git-send-email-ddaney.cavm@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.57E34A2A.00C3,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e7ed575bc6899230f914a469a5271d89 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/9/21 2:46, David Daney wrote: > From: David Daney > > Fix by moving call to numa_store_cpu_info() for all CPUs into > smp_prepare_cpus(), which happens before wq_numa_init(). Since > smp_store_cpu_info() now contains only a single function call, > simplify by removing the function and out-lining its contents. > > Suggested-by: Robert Richter > fixes: 1a2db300348b ("arm64, numa: Add NUMA support for arm64 platforms.") > Cc: # 4.7.x- > Signed-off-by: David Daney > --- Tested-by: Yisheng Xie Thanks. > arch/arm64/kernel/smp.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index d93d433..3ff173e 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -201,12 +201,6 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) > return ret; > } > > -static void smp_store_cpu_info(unsigned int cpuid) > -{ > - store_cpu_topology(cpuid); > - numa_store_cpu_info(cpuid); > -} > - > /* > * This is the secondary CPU boot entry. We're using this CPUs > * idle thread stack, but a set of temporary page tables. > @@ -254,7 +248,7 @@ asmlinkage void secondary_start_kernel(void) > */ > notify_cpu_starting(cpu); > > - smp_store_cpu_info(cpu); > + store_cpu_topology(cpu); > > /* > * OK, now it's safe to let the boot CPU continue. Wait for > @@ -689,10 +683,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) > { > int err; > unsigned int cpu; > + unsigned int this_cpu; > > init_cpu_topology(); > > - smp_store_cpu_info(smp_processor_id()); > + this_cpu = smp_processor_id(); > + store_cpu_topology(this_cpu); > + numa_store_cpu_info(this_cpu); > > /* > * If UP is mandated by "nosmp" (which implies "maxcpus=0"), don't set > @@ -719,6 +716,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) > continue; > > set_cpu_present(cpu, true); > + numa_store_cpu_info(cpu); > } > } > >