lkml.org 
[lkml]   [2013]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] perf: Sanitize get_callchain_buffer()
On Thu, Aug 01, 2013 at 03:54:01PM +0200, Jiri Olsa wrote:
> On Thu, Aug 01, 2013 at 03:49:36PM +0200, Frederic Weisbecker wrote:
> > On Thu, Aug 01, 2013 at 03:32:17PM +0200, Jiri Olsa wrote:
> > > On Thu, Aug 01, 2013 at 03:28:34PM +0200, Frederic Weisbecker wrote:
> > >
> > > SNIP
> > >
> > > > > also for following case:
> > > > >
> > > > > count = atomic_inc_return(&nr_callchain_events);
> > > > > if (WARN_ON_ONCE(count < 1)) {
> > > > > err = -EINVAL;
> > > > > goto exit;
> > > > > }
> > > > >
> > > > > seems like it screws the count
> > > >
> > > > I'm not sure what you mean here. You mean that it could be negative when the dec is done
> > > > outside the lock?
> > >
> > > yes
> > >
> >
> > I don't understand why.
>
> ah ok, with the count being 0 the nr_callchain_events still
> increments right? then it's ok..

Yep. But I still need to move the dec into the lock though.

Thanks for catching this!


\
 
 \ /
  Last update: 2013-08-01 16:21    [W:1.640 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site