Messages in this thread | | | Subject | Re: [RFC][PATCH] ftrace: Use schedule_on_each_cpu() as a heavy synchronize_sched() | From | Steven Rostedt <> | Date | Wed, 05 Jun 2013 09:36:26 -0400 |
| |
On Wed, 2013-06-05 at 13:51 +0200, Peter Zijlstra wrote:
> > @@ -456,9 +471,13 @@ static int __unregister_ftrace_function( > > /* > > * Dynamic ops may be freed, we must make sure that all > > * callers are done before leaving this function. > > + * > > + * Again, normal synchronize_sched() is not good enough. > > + * We need to do a hard force of sched synchronization. > > */ > > if (ops->flags & FTRACE_OPS_FL_DYNAMIC) > > - synchronize_sched(); > > + schedule_on_each_cpu(ftrace_sync); > > + > > > > return 0; > > } > > > > So what happens if schedule_on_each_cpu() returns -ENOMEM? :-)
Hah! I was thinking the same thing when I wrote it, but as this was just an RFC, I wanted to hear more about this current approach before adding more.
I was going to also add something like this:
if (schedule_on_each_cpu(ftrace_sync) < 0) { /* * Crap, memory pressure caused this to fail. * Do a synchronize_sched() and then a msleep(). * The race that fails synchronize_sched() is really small * and a msleep() should clear it (but not guaranteed like * a schedule_on_each_cpu() does). */ synchronize_sched(); msleep(5); }
-- Steve
| |