19 Aug, 2013

1 commit

  • If someone does a duplicate call_rcu(), the worst thing the second
    call_rcu() could do would be to actually queue the callback the second
    time because doing so corrupts whatever list the callback was already
    queued on. This commit therefore makes __call_rcu() check the new
    return value from debug-objects and leak the callback upon error.
    This commit also substitutes rcu_leak_callback() for whatever callback
    function was previously in place in order to avoid freeing the callback
    out from under any readers that might still be referencing it.

    These changes increase the probability that the debug-objects error
    messages will actually make it somewhere visible.

    Signed-off-by: Paul E. McKenney
    Cc: Mathieu Desnoyers
    Cc: Sedat Dilek
    Cc: Davidlohr Bueso
    Cc: Rik van Riel
    Cc: Thomas Gleixner
    Cc: Linus Torvalds
    Tested-by: Sedat Dilek
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

30 Jul, 2013

1 commit

  • All the RCU tracepoints and functions that reference char pointers do
    so with just 'char *' even though they do not modify the contents of
    the string itself. This will cause warnings if a const char * is used
    in one of these functions.

    The RCU tracepoints store the pointer to the string to refer back to them
    when the trace output is displayed. As this can be minutes, hours or
    even days later, those strings had better be constant.

    This change also opens the door to allow the RCU tracepoint strings and
    their addresses to be exported so that userspace tracing tools can
    translate the contents of the pointers of the RCU tracepoints.

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

29 Jan, 2013

1 commit

  • Tiny RCU has historically omitted RCU CPU stall warnings in order to
    reduce memory requirements, however, lack of these warnings caused
    Thomas Gleixner some debugging pain recently. Therefore, this commit
    adds RCU CPU stall warnings to tiny RCU if RCU_TRACE=y. This keeps
    the memory footprint small, while still enabling CPU stall warnings
    in kernels built to enable them.

    Updated to include Josh Triplett's suggested use of RCU_STALL_COMMON
    config variable to simplify #if expressions.

    Reported-by: Thomas Gleixner
    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

24 Oct, 2012

1 commit

  • There have been some embedded applications that would benefit from
    use of expedited grace-period primitives. In some ways, this is
    similar to synchronize_net() doing either a normal or an expedited
    grace period depending on lock state, but with control outside of
    the kernel.

    This commit therefore adds rcu_expedited boot and sysfs parameters
    that cause the kernel to substitute expedited primitives for the
    normal grace-period primitives.

    [ paulmck: Add trace/event/rcu.h to kernel/srcu.c to avoid build error.
    Get rid of infinite loop through contention path.]

    Signed-off-by: Antti P Miettinen
    Signed-off-by: Paul E. McKenney

    Antti P Miettinen
     

22 Feb, 2012

3 commits

  • Use of RCU in the idle loop is incorrect, quite a few instances of
    just that have made their way into mainline, primarily event tracing.
    The problem with RCU read-side critical sections on CPUs that RCU believes
    to be idle is that RCU is completely ignoring the CPU, along with any
    attempts and RCU read-side critical sections.

    The approaches of eliminating the offending uses and of pushing the
    definition of idle down beyond the offending uses have both proved
    impractical. The new approach is to encapsulate offending uses of RCU
    with rcu_idle_exit() and rcu_idle_enter(), but this requires nesting
    for code that is invoked both during idle and and during normal execution.
    Therefore, this commit modifies rcu_idle_enter() and rcu_idle_exit() to
    permit nesting.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett
    Acked-by: Deepthi Dharwar

    Paul E. McKenney
     
  • There is now an unconditional check for rcu_head misalignment in
    __call_rcu(), so remove the old conditional one in debug_rcu_head_queue().

    Reported-by: Josh Triplett
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • When CONFIG_RCU_FAST_NO_HZ is enabled, RCU will allow a given CPU to
    enter dyntick-idle mode even if it still has RCU callbacks queued.
    RCU avoids system hangs in this case by scheduling a timer for several
    jiffies in the future. However, if all of the callbacks on that CPU
    are from kfree_rcu(), there is no reason to wake the CPU up, as it is
    not a problem to defer freeing of memory.

    This commit therefore tracks the number of callbacks on a given CPU
    that are from kfree_rcu(), and avoids scheduling the timer if all of
    a given CPU's callbacks are from kfree_rcu().

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

12 Dec, 2011

1 commit

  • The trace_rcu_dyntick() trace event did not print both the old and
    the new value of the nesting level, and furthermore printed only
    the low-order 32 bits of it. This could result in some confusion
    when interpreting trace-event dumps, so this commit prints both
    the old and the new value, prints the full 64 bits, and also selects
    the process-entry/exit increment to print nicely in hexadecimal.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

29 Sep, 2011

3 commits

  • Add trace events to record grace-period start and end, quiescent states,
    CPUs noticing grace-period start and end, grace-period initialization,
    call_rcu() invocation, tasks blocking in RCU read-side critical sections,
    tasks exiting those same critical sections, force_quiescent_state()
    detection of dyntick-idle and offline CPUs, CPUs entering and leaving
    dyntick-idle mode (except from NMIs), CPUs coming online and going
    offline, and CPUs being kicked for staying in dyntick-idle mode for too
    long (as in many weeks, even on 32-bit systems).

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    rcu: Add the rcu flavor to callback trace events

    The earlier trace events for registering RCU callbacks and for invoking
    them did not include the RCU flavor (rcu_bh, rcu_preempt, or rcu_sched).
    This commit adds the RCU flavor to those trace events.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • In order to allow event tracing to distinguish between flavors of
    RCU, we need those names in the relevant RCU data structures. TINY_RCU
    has avoided them for memory-footprint reasons, so add them only if
    CONFIG_RCU_TRACE=y.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • There was recently some controversy about the overhead of invoking RCU
    callbacks. Add TRACE_EVENT()s to obtain fine-grained timings for the
    start and stop of a batch of callbacks and also for each callback invoked.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney