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]
Date:	Tue, 11 May 2010 01:09:13 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Lin Ming <ming.m.lin@...el.com>, Ingo Molnar <mingo@...e.hu>,
	"eranian@...il.com" <eranian@...il.com>,
	"Gary.Mohr@...l.com" <Gary.Mohr@...l.com>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
	"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
	Paul Mackerras <paulus@...ba.org>,
	"David S. Miller" <davem@...emloft.net>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Paul Mundt <lethal@...ux-sh.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH 2/9] perf: core, remove hw_perf_event_init

On Mon, May 10, 2010 at 02:54:14PM +0200, Peter Zijlstra wrote:
> On Mon, 2010-05-10 at 14:27 +0200, Frederic Weisbecker wrote:
> > On Mon, May 10, 2010 at 12:19:29PM +0200, Peter Zijlstra wrote:
> > > On Mon, 2010-05-10 at 18:17 +0800, Lin Ming wrote:
> > > > On Mon, 2010-05-10 at 17:40 +0800, Peter Zijlstra wrote:
> > > > > On Mon, 2010-05-10 at 17:26 +0800, Lin Ming wrote:
> > > > > > +static struct pmu *perf_event_lookup_pmu(struct perf_event *event)
> > > > > > +{
> > > > > > +       struct pmu *pmu;
> > > > > > +       int pmu_id = event->attr.pmu_id;
> > > > > > +
> > > > > > +       list_for_each_entry(pmu, &pmus, entry) {
> > > > > > +               if (pmu->id == pmu_id)
> > > > > > +                       return pmu;
> > > > > > +       }
> > > > > > +
> > > > > > +       return NULL;
> > > > > > +}
> > > > > 
> > > > > > +void perf_event_register_pmu(struct pmu *pmu)
> > > > > > +{
> > > > > > +       pmu->id = pmu_id_curr++;
> > > > > > +       list_add_tail(&pmu->entry, &pmus);
> > > > > > +} 
> > > > > 
> > > > > That will be wanting some sort of synchronization
> > > > 
> > > > Will add a mutex to protect the list of pmus.
> > > 
> > > I'm thinking RCU might be better suited, a mutex for lookup doesn't
> > > sound ideal.
> > 
> > 
> > Is it really needed? I expect this function to be called on boot
> > only.
> > 
> > In fact I would even suggest to tag it as __init.
> 
> Loadable modules as well as PCI-Hotplug need supporting.


Which module do you have in mind that could register a pmu?
And I don't understand the problem with pci-hotplug.

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