lkml.org 
[lkml]   [2010]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH v2 02/11] perf: core, add pmu register and lookup functions
From
Date
On Wed, 2010-05-19 at 02:38 +0800, Cyrill Gorcunov wrote:
> On Wed, May 19, 2010 at 01:45:02AM +0000, Lin Ming wrote:
> ...
> > +int perf_event_register_pmu(struct pmu *pmu)
> > +{
> > + struct pmu *tmp;
> > + int ret = 1;
> > +
> > + rcu_read_lock();
> > + list_for_each_entry_rcu(tmp, &pmus, entry) {
> > + if (tmp->id == pmu->id) {
> > + ret = 0;
> > + goto err;
>
> Hi Ming, is it supposed to get out in locked state?
> I mean imbalanced rcu_read_lock somehow suspicicous ;)

Ah, yes, that's real bug.
I'll fix it.

Thanks for review.

>
> > + }
> > + }
> > + rcu_read_unlock();
> > +
> > + spin_lock(&pmus_lock);
> > + list_add_tail_rcu(&pmu->entry, &pmus);
> > + spin_unlock(&pmus_lock);
> > +
> > +err:
> > + return ret;
> > +}
> > +
> ...
>
> -- Cyrill



\
 
 \ /
  Last update: 2010-05-19 04:03    [W:0.060 / U:1.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site