lkml.org 
[lkml]   [2011]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH,RFC] perf: panic due to inclied cpu context task_ctx value
From
Date
On Wed, 2011-03-30 at 17:32 +0200, Oleg Nesterov wrote:
> > +#ifdef HAVE_JUMP_LABEL
> > +static inline
> > +void perf_sched_events_inc(void)
> > +{
> > + jump_label_inc(&perf_sched_events_out);
> > + smp_mb__after_atomic_inc();
> > + jump_label_inc(&perf_sched_events_in);
> > +}
> > +
> > +static inline
> > +void perf_sched_events_dec(void)
> > +{
> > + if (atomic_dec_and_test(&perf_sched_events_in)) {
> > + jump_label_disable(&perf_sched_events_in);
> > + synchronize_sched();
> > + }
> > +
> > + jump_label_dec(&perf_sched_events_out);
>
> probably smp_mb__after_atomic_inc() needs a comment...

You don't need it, jump_label_inc() uses atomic_add_return() which
implies a full mb.


\
 
 \ /
  Last update: 2011-03-30 17:43    [W:0.214 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site