lkml.org 
[lkml]   [2010]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: wake up tasks reading trace_pipe on write to trace_marker
On Fri, Aug 06, 2010 at 05:29:35PM -0400, Steven Rostedt wrote:
> On Fri, 2010-08-06 at 22:55 +0200, Frederic Weisbecker wrote:
>
> > > This can't work. trace_printk() and friends must be able to be used
> > > anywhere. This can cause race conditions with the rq locks in the
> > > scheduler.
> > >
> > > But you do bring up a good idea. That is, perhaps we should have a way
> > > to attach to known safe tracepoints that we can hook to to check if a
> > > wake up should happen or not.
> >
> >
> > This could be a simple macro that takes the name of the trace event:
> >
> >
> > DEFINE_EVENT(event_tpl, event_name, ...);
> >
> >
> > TRACE_EVENT_NO_WAKE(event_name);
> >
>
> Yeah, that may be worth doing for 2.6.37. Might as well also add a
> trace_printk_nowake() too, when you know you are in dangerous locations
> like the scheduler or NMI.



Yeah.



>
> > I think trace events should be wakeable by default as it looks safe for
> > most of them. But probably we don't want that per event class.
> >
> > In the unsafe list, I only have some sched and lock events in
> > mind, but I bet there are some others.
>
> Yep, will put that on my todo list.
>
> Thanks,


Cool. This is going to be useful in perf as well. The "nmi" argument in
perf_swevent_add tells wether we can wake up or not. If not we do a
kind of delayed wake up using a self IPI.

Currently we always consider we can't wake up when a trace event triggers.
If we know we can wake up, this is going to be less costly.



\
 
 \ /
  Last update: 2010-08-06 23:53    [W:0.046 / U:20.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site