lkml.org 
[lkml]   [2012]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V6 07/13] perf: Generic pci uncore device support
From
Date
On Fri, 2012-06-15 at 14:31 +0800, Yan, Zheng wrote:
> @@ -305,6 +310,22 @@ struct intel_uncore_box *uncore_alloc_box(int cpu)
> static struct intel_uncore_box *
> uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu)
> {
> + static struct intel_uncore_box *box;
> +
> + box = *per_cpu_ptr(pmu->box, cpu);
> + if (box)
> + return box;
> +
> + raw_spin_lock(&uncore_box_lock);
> + list_for_each_entry(box, &pmu->box_list, list) {
> + if (box->phys_id == topology_physical_package_id(cpu)) {
> + atomic_inc(&box->refcnt);
> + *per_cpu_ptr(pmu->box, cpu) = box;
> + break;
> + }
> + }
> + raw_spin_unlock(&uncore_box_lock);
> +
> return *per_cpu_ptr(pmu->box, cpu);
> }

So why can't we do that lookup from a hotplug notifier?


\
 
 \ /
  Last update: 2012-06-15 18:21    [W:0.138 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site