From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756991AbdKGWUH (ORCPT ); Tue, 7 Nov 2017 17:20:07 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:44290 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754732AbdKGWUF (ORCPT ); Tue, 7 Nov 2017 17:20:05 -0500 Date: Tue, 7 Nov 2017 23:19:55 +0100 (CET) From: Thomas Gleixner To: Prarit Bhargava cc: linux-kernel@vger.kernel.org, Andi Kleen , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Dave Hansen , Piotr Luc , Kan Liang , Borislav Petkov , Stephane Eranian , Arvind Yadav , Andy Lutomirski , Christian Borntraeger , "Kirill A. Shutemov" , Tom Lendacky , He Chen , Mathias Krause , Tim Chen , Vitaly Kuznetsov Subject: Re: [PATCH v5 1/3] perf/x86/intel/uncore: Cache logical pkg id in uncore driver In-Reply-To: <20171105165428.32108-2-prarit@redhat.com> Message-ID: References: <20171105165428.32108-1-prarit@redhat.com> <20171105165428.32108-2-prarit@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 On Sun, 5 Nov 2017, Prarit Bhargava wrote: > diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c > index d45e06346f14..87ef77982248 100644 > --- a/arch/x86/events/intel/uncore.c > +++ b/arch/x86/events/intel/uncore.c > @@ -947,6 +947,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id > > atomic_inc(&box->refcnt); > box->pci_phys_id = phys_id; > + box->logical_pkg_id = topology_phys_to_logical_pkg(box->pci_phys_id); So in that same function topology_phys_to_logical_pkg() has been called already and the result is in the local variable 'pkg' which gets assigned in the very next line..... > box->pkgid = pkg; > box->pci_dev = pdev; > box->pmu = pmu; uncore_pci_remove() does not use the cached data either. Can we please make that consistent? Thanks, tglx