From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938605AbcHJTOg (ORCPT ); Wed, 10 Aug 2016 15:14:36 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34238 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934359AbcHJTMa (ORCPT ); Wed, 10 Aug 2016 15:12:30 -0400 Date: Wed, 10 Aug 2016 17:52:05 +0200 From: Peter Zijlstra To: Jiri Olsa Cc: Thomas Gleixner , Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen , x86@kernel.org, Ingo Molnar , Frank Ramsay , Prarit Bhargava Subject: Re: [RFC][PATCH] x86/smp: Fix __max_logical_packages value setup Message-ID: <20160810155205.GR30192@twins.programming.kicks-ass.net> References: <20160803162358.GA10890@krava> <20160810135417.GP30192@twins.programming.kicks-ass.net> <20160810140033.GA23798@krava> <20160810141538.GA28551@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160810141538.GA28551@krava> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 10, 2016 at 04:15:38PM +0200, Jiri Olsa wrote: > it's very likely I'm missing something, but seems to me > that attached patch (untested) might work as well Hmm, I think you're right. Earlier code (which hasn't survived) tried to match logical and physical if possible, but that was busted and got removed. The code as is should indeed allow for this. Maybe one nit, the variable is no longer used for a max, so maybe rename it too? > --- > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index 157bf0957219..003208bc8e44 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -277,14 +276,8 @@ int topology_update_package_map(unsigned int apicid, unsigned int cpu) > if (test_and_set_bit(pkg, physical_package_map)) > goto found; > > + new = __max_logical_packages++; > + > pr_info("APIC(%x) Converting physical %u to logical package %u\n", > apicid, pkg, new); > physical_to_logical_pkg[pkg] = new; > @@ -340,7 +333,7 @@ static void __init smp_init_package_map(void) > ncpus = 1; > } > > + __max_logical_packages = 0; > > /* > * Possibly larger than what we need as the number of apic ids per