From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933193AbcJLWWM (ORCPT ); Wed, 12 Oct 2016 18:22:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:57648 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533AbcJLWWG (ORCPT ); Wed, 12 Oct 2016 18:22:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,485,1473145200"; d="scan'208";a="19054314" Message-ID: <1476310004.4440.16.camel@linux.intel.com> Subject: Re: [PATCH] arch/x86: Remove second call to topology_update_package_map() From: Tim Chen To: Prarit Bhargava , linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Len Brown , Borislav Petkov , Andi Kleen , Boris Ostrovsky , Jiri Olsa Date: Wed, 12 Oct 2016 15:06:44 -0700 In-Reply-To: <57FEA313.4060400@redhat.com> References: <1476282988-9476-1-git-send-email-prarit@redhat.com> <57FE5171.3030305@redhat.com> <1476301900.4440.6.camel@linux.intel.com> <57FEA313.4060400@redhat.com> 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 Wed, 2016-10-12 at 16:54 -0400, Prarit Bhargava wrote: > > On 10/12/2016 03:51 PM, Tim Chen wrote: > > > > On Wed, 2016-10-12 at 11:06 -0400, Prarit Bhargava wrote: > > > > > > > > > On 10/12/2016 10:36 AM, Prarit Bhargava wrote: > > > > > > > > > > > > This was noticed during the investigation of > > > > > > > > http://git.kernel.org/tip/2a51fe083eba7f99cbda72f5ef90cdf2f4df882c > > > > > > > > A note for reviewers on the cleanup in smp_init_package_map(): The > > > > per_cpu variable x86_bios_cpu_apicid is initialized to BAD_APICID, and the > > > > bitmaps are set to false by default so the code isn't necessary.  The > > > > pr_warn() can also be dropped as generic_processor_info() will do a > > > > pr_warning() in the same situation. > > > > > > > > > > > > > > > > P. > > > > > > > > -----8<----- > > > > > > > > After commit 1f12e32f4cd5 ("x86/topology: Create logical package id"), > > > > topology_update_package_map() is called twice on a CPU.  The first call is in > > > > generic_processor_info(), which is called on all present cpus (found in either > > > > mptable or ACPI MADT).  The second call is in smp_init_package_map() which > > > > is called later on in the init sequence. > > > > > > > > Only a single call is necessary for the kernel to initialize the data > > > > structures properly. This patch drops the later call in smp_init_package_map() > > > > and moves smp_init_package_map() out of smp_store_boot_cpu_info(). > > > > > > > Self-NAK. > > > > > > This seems to not work on systems with an empty socket :/.  Looking into this now. > > > > > > P. > > My single node workstation also failed to boot with the patch. > The patch is incorrect.  I'm dropping it completely. > The call from generic_processor_info to topology_update_package_map during early boot was essentially no op, as physical_package_map has not have been allocated by smp_init_package_map yet. We have to call topology_update_package_map in smp_init_package_map after allocating physical_package_map to properly set up physical_package_map. Tim