lkml.org 
[lkml]   [2008]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: use raw spinlocks instead of spinlocks
2008/11/3 Steven Rostedt <rostedt@goodmis.org>:
> Frederic,
>
> Ingo has been very adamant about not using raw_spin_locks in the ring
> buffers. My original code did this, and he nacked it. The reason being
> (and he eventually convinced me) was that by using raw, we not only do not
> trace the locking, we also remove the lock checking. This code can easily
> produce deadlocks, so we do not want the lock checking removed.

Ok. I understand...

> The real fix is to find a way in your tracer to detect the recursion, and
> be able to prevent it. Like the atomic disables I use in ftrace. It does
> the same thing. It leaves the lockdep checking on its own locks, but can
> also detect if the lock checking caused it to recurse. When the recusion
> is detected, the tracer itself will not trace.

You mean this part in function_trace_call?

disabled = atomic_inc_return(&data->disabled);
if (likely(disabled == 1))
trace_function(tr, data, ip, parent_ip, flags, pc);

atomic_dec(&data->disabled);

That's a good idea. Since it applies on one cpu_data specific and
preempt and irq are disabled, the function
tracer doesn't risk to loose a trace. I think I will apply the same method.

Thanks!

> [ I hope this makes sense, I'm writing this on 3 hours of sleep ]

Yes, don't worry :-)


\
 
 \ /
  Last update: 2008-11-03 02:21    [W:0.144 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site