From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754682AbcH2Rs7 (ORCPT ); Mon, 29 Aug 2016 13:48:59 -0400 Received: from mga06.intel.com ([134.134.136.31]:18165 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbcH2Rs6 (ORCPT ); Mon, 29 Aug 2016 13:48:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,597,1470726000"; d="scan'208";a="1042997799" Message-ID: <1472492658.2916.81.camel@linux.intel.com> Subject: Re: [PATCH] x86, cpu: Fix node state for whether it contains CPU From: Tim Chen To: Peter Zijlstra Cc: Andrew Morton , Ingo Molnar , "H. Peter Anvin" , "Huang, Ying" , Andi Kleen , Dave Hansen , Dan Williams , linux-kernel@vger.kernel.org Date: Mon, 29 Aug 2016 10:44:18 -0700 In-Reply-To: <20160829133612.GQ10153@twins.programming.kicks-ass.net> References: <20160824232647.GA21759@linux.intel.com> <20160829133612.GQ10153@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2016-08-29 at 15:36 +0200, Peter Zijlstra wrote: > On Wed, Aug 24, 2016 at 04:26:49PM -0700, Tim Chen wrote: > >  > > > > Signed-off-by: Tim Chen > > --- > >  arch/x86/kernel/smpboot.c | 1 + > >  1 file changed, 1 insertion(+) > > > > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > > index d8f7d01..04c0574 100644 > > --- a/arch/x86/kernel/smpboot.c > > +++ b/arch/x86/kernel/smpboot.c > > @@ -259,6 +259,7 @@ static void notrace start_secondary(void *unused) > >   lock_vector_lock(); > >   setup_vector_irq(smp_processor_id()); > >   set_cpu_online(smp_processor_id(), true); > > + node_set_state(cpu_to_node(smp_processor_id()), N_CPU); > >   unlock_vector_lock(); > >   cpu_set_state_online(smp_processor_id()); > >   x86_platform.nmi_init(); > Would it not be easier to register the vmstat_notifier earlier, before > SMP bringup? Because with this change, we need to go fix all > architectures. I think checking all nodes for online cpus when we init vmstat is probably the more straightforward way to go. We can do this after SMP bring up. I'll update the patch for that. Thanks. Tim