Re: [PATCH] LTT for 2.5.38 1/9: Core infrastructure

Ingo Molnar (mingo@elte.hu)
Mon, 23 Sep 2002 00:59:15 +0200 (CEST)


On Sun, 22 Sep 2002, Karim Yaghmour wrote:

> Ingo Molnar wrote:
> > +int trace_event(u8 pm_event_id,
> > + void *pm_event_struct)
> > [...]
> > + read_lock(&tracer_register_lock);
> >
> > ie. it's using a global spinlock. (sure, it can be made lockless, as other
> > tracers have done it.)
>
> It is, but this is separate from the trace driver. [...]

it does not matter, it's called for every event.

> [...] This global spinlock is only used to avoid a race condition in the
> registration/ unregistration of the tracing function with the trace
> infrastructure.

(here you make the incorrect assumption that read-locking a rwlock is a
lightweight operation.)

Ingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/