[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090429055512.GB6148@elte.hu>
Date: Wed, 29 Apr 2009 07:55:12 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 1/5] tracing: convert ftrace_dump spinlocks to raw
* Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Wed, 29 Apr 2009 00:48:15 -0400 Steven Rostedt <rostedt@...dmis.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists