lkml.org 
[lkml]   [2009]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] tracing/events/lockdep: move tracepoints within recursive protection

    On Thu, 16 Apr 2009, Peter Zijlstra wrote:

    > On Thu, 2009-04-16 at 13:03 -0400, Steven Rostedt wrote:
    > > On Thu, 16 Apr 2009, Peter Zijlstra wrote:
    > >
    > > > On Thu, 2009-04-16 at 12:15 -0400, Steven Rostedt wrote:
    > > > > plain text document attachment
    > > > > (0002-tracing-events-lockdep-move-tracepoints-within-recu.patch)
    > > > > From: Steven Rostedt <srostedt@redhat.com>
    > > > >
    > > > > With the current location of the tracepoints in lockdep, the system
    > > > > can hard lockup in minutes when the tracepoints are enabled.
    > > > >
    > > > > Moving the tracepoints outside inside the lockdep protection solves
    > > > > the issue.
    > > >
    > > > NAK
    > > >
    > > > the idea is to eventually move lockdep on top of the tracepoints. The
    > > > tracer should grow to be more robust and handle recursion itself.
    > > >
    > > > Its likely a case of the tracer using a spinlock or mutex in the
    > > > tracepoint code. When I did the tracepoints I converted one such to a
    > > > raw_spinlock_t in the trace_print code.
    > >
    > > Note, that the ring buffer and events are made to be recursive. That is,
    > > it allows one event to trace within another event.
    >
    > But surely not in the same context. You could do a 4 level recursion
    > protection like I did in perf-counter, not allowing recursion in:
    >
    > nmi, irq, softirq, process - context.

    Why not allow a nested interrupt to trace?

    I don't want to add this logic to the lower levels, where only a few
    users need the protection. The protecting should be at the user level.

    >
    > That allows you to trace an irq while you're tracing something in
    > process context, etc.. But not allow recursion on the same level.
    >
    > > If the tracepoint is
    > > triggered by something within the trace point handler, then we are
    > > screwed. That needs to be fixed.
    >
    > Exactly the thing you want to detect and warn about, preferably with a
    > nice stack trace.

    Its hard when you want to allow nesting.

    >
    > > I have not seen what is triggering back into locking. The ring buffer and
    > > what I can see by the event code, does not grab any locks besides raw
    > > ones.
    >
    > Well, it used to all work, so something snuck in.

    Note, it seems only the lockdep has issues with nesting. Perhaps when I
    can publish the lockless ring buffer this will all go away?

    -- Steve



    \
     
     \ /
      Last update: 2009-04-16 19:41    [W:3.857 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site