Re: [PATCH v5 1/3] perf/x86/intel/uncore: Cache logical pkg id in uncore driver

Thomas Gleixner
2017-11-07T22:20:07Z

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