lkml.org 
[lkml]   [2009]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] tracing: convert ftrace_dump spinlocks to raw

* Andrew Morton <akpm@linux-foundation.org> wrote:

> On Wed, 29 Apr 2009 00:48:15 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > + local_irq_save(flags);
> > + __raw_spin_lock(&ftrace_dump_lock);
>
> I'm counting twentyish instances of this. [...]

there's 9 in the tracing code, two more in the rest of the kernel.

> [...] Maybe it's time to give up and implement
> raw_spin_lock_irqsave().

There's a difference between:

local_irq_save(flags);
__raw_spin_lock(&ftrace_dump_lock);

and:

raw_local_irq_save(flags);
__raw_spin_lock(&ftrace_dump_lock);

raw_spin_lock_irqsave() would map to the latter logic-wise - but in
the tracing code we want the former.

But the main reason is that using raw locks has its costs - it skips
lockdep coverage, is preempt unsafe, etc. The APIs are not complete
and intentionally so: they are minimal building blocks for the real
APIs. Instrumentation goes deep in the guts of the kernel so using
very low level primitives is justified there - but we dont want to
make it _too_ easy to use a raw-anything locking facility.

Ingo


\
 
 \ /
  Last update: 2009-04-29 07:57    [W:1.454 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site