From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425305AbcBRINZ (ORCPT ); Thu, 18 Feb 2016 03:13:25 -0500 Received: from casper.infradead.org ([85.118.1.10]:48272 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425220AbcBRINY (ORCPT ); Thu, 18 Feb 2016 03:13:24 -0500 Date: Thu, 18 Feb 2016 09:13:20 +0100 From: Peter Zijlstra To: Andi Kleen Cc: Thomas Gleixner , Stephane Eranian , LKML , Ingo Molnar , Borislav Petkov , Harish Chegondi , Kan Liang , Andi Kleen Subject: Re: [patch 07/11] x86/perf/uncore: Track packages not per cpu data Message-ID: <20160218081320.GQ6357@twins.programming.kicks-ass.net> References: <20160217132903.767990400@linutronix.de> <20160217133932.279611021@linutronix.de> <878u2j9gjr.fsf@tassilo.jf.intel.com> <20160217221640.GD5083@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217221640.GD5083@two.firstfloor.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 17, 2016 at 11:16:40PM +0100, Andi Kleen wrote: > > Do you have any data to back that up or is that just "believe" ? > > I've seen systems with discontiguous apic ids before. > > It is obvious if you consider setups with node hotplug. Those systems will also have a num_possible_cpus() that's inflated to account for the possible hotplug of new sockets, right? So while the phys_pkg_id of the present sockets might be 2 and 3 (leaving 0 and 1 available for hotplug), the num_possible_cpus() should be big enough to actually allow for that hotplug to happen. Because if num_possible_cpus() is too small, we could not accommodate the hotplug operation. And if num_possible_cpus() is of the right size, then the computed max_packages() should be of the right size too. Now clearly, BIOS can completely wreck things and indeed report too small an apic_id range or whatever, and in this case we're up a creek without a paddle. But I think you can check for that at boot and report errors/warns whatever, because if you trigger this, your system is not really 'correct' anyway.