lkml.org 
[lkml]   [2013]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/18 v2] ftrace: Add hash list to save RCU unsafe functions
On Tue, 3 Sep 2013 21:51:52 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> > > void ftrace_unsafe_rcu_checker_disable(void)
> > > {
> > > atomic_inc(&ftrace_unsafe_rcu_disabled);
> > > + /* Make sure the update is seen immediately */
> > > + smp_wmb();
> >
> > smp_mb__after_atomic_inc()?
>
> Yep.
>
> >
> > > }
> > >
> > > void ftrace_unsafe_rcu_checker_enable(void)
> > > {
> > > atomic_dec(&ftrace_unsafe_rcu_disabled);
> > > + /* Make sure the update is seen immediately */
> > > + smp_wmb();
> >
> > smp_mb__after_atomic_dec()?
>
> Yep.
>
> >
> > > }
> > >
> > > static DEFINE_PER_CPU(unsigned long, ftrace_rcu_func);
> > > @@ -588,15 +593,14 @@ static void
> > > ftrace_unsafe_callback(unsigned long ip, unsigned long parent_ip,
> > > struct ftrace_ops *op, struct pt_regs *pt_regs)
> > > {
> > > - int bit;
> > > -
> > > + /* Make sure we see disabled or not first */
> > > + smp_rmb();
> >
> > smp_mb__before_atomic_inc()?
>
> Yep.
>
> I'll update it and restart my tests.
>

Although, this will punish archs that need the mb(), as IIUC, smp_mb()
is heavier weight than smp_wmb() or smp_rmb().

-- Steve


\
 
 \ /
  Last update: 2013-09-04 04:01    [W:0.944 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site