From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424224AbcBQV1L (ORCPT ); Wed, 17 Feb 2016 16:27:11 -0500 Received: from www.linutronix.de ([62.245.132.108]:46057 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423509AbcBQV1I (ORCPT ); Wed, 17 Feb 2016 16:27:08 -0500 Date: Wed, 17 Feb 2016 22:25:51 +0100 (CET) From: Thomas Gleixner To: Stephane Eranian cc: LKML , Peter Zijlstra , Ingo Molnar , Borislav Petkov , Harish Chegondi , Kan Liang , Andi Kleen Subject: Re: [patch 07/11] x86/perf/uncore: Track packages not per cpu data In-Reply-To: Message-ID: References: <20160217132903.767990400@linutronix.de> <20160217133932.279611021@linutronix.de> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephane, On Wed, 17 Feb 2016, Stephane Eranian wrote: Please trim your replies. > On Wed, Feb 17, 2016 at 5:47 AM, Thomas Gleixner wrote: > > + size = topology_max_packages() * sizeof(struct intel_uncore_box *); > > > Let's assume you have a system with 48 cpus with HT on, then > you have 2 processor sockets, which is correct. But then you further > assume that topology_physical_package_id() will return 0 or 1 in this case. > In other words, that physical id are always assigned from 0 to N in a contiguous > manner. > > Do we know for sure that this is always the case for all Intel systems > and that no > weird BIOS is assigning random numbers for phys_proc_id? We have quite some stuff which depends on phys_proc_id < max_package_id. But sure, we should add a sanity check somewhere if we don't have one already. I'll go digging around in the cpu setup code. Thanks, tglx