lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1340005388.15222.17.camel@twins>
Date:	Mon, 18 Jun 2012 09:43:08 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	"Yan, Zheng" <zheng.z.yan@...el.com>
Cc:	mingo@...e.hu, jolsa@...hat.com, eranian@...gle.com,
	andi@...stfloor.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V6 07/13] perf: Generic pci uncore device support

On Mon, 2012-06-18 at 11:06 +0800, Yan, Zheng wrote:
> On 06/16/2012 12:02 AM, Peter Zijlstra wrote:
> > 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?
> > 
> We can. But I personally prefer not to mix pci uncore initialization
> code with cpu hotplug notifier. Because pci hotplug and cpu hotplug
> are separate process, I'm not completely sure which one happens first.

I suspect nobody does.. OK we'll leave it as it is. Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ