11 Jun, 2013

3 commits

  • Now that TINY_PREEMPT_RCU is no more, exit_rcu() is always an empty
    function. But if TINY_RCU is going to have an empty function, it should
    be in include/linux/rcutiny.h, where it does not bloat the kernel.
    This commit therefore moves exit_rcu() out of kernel/rcupdate.c to
    kernel/rcutree_plugin.h, and places a static inline empty function in
    include/linux/rcutiny.h in order to shrink TINY_RCU a bit.

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

    Paul E. McKenney
     
  • TINY_PREEMPT_RCU could use a kthread to handle RCU callback invocation,
    which required an API to abstract kthread vs. softirq invocation.
    Now that TINY_PREEMPT_RCU is no longer with us, this commit retires
    this API in favor of direct use of the relevant softirq primitives.

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

    Paul E. McKenney
     
  • TINY_PREEMPT_RCU adds significant code and complexity, but does not
    offer commensurate benefits. People currently using TINY_PREEMPT_RCU
    can get much better memory footprint with TINY_RCU, or, if they really
    need preemptible RCU, they can use TREE_PREEMPT_RCU with a relatively
    minor degradation in memory footprint. Please note that this move
    has been widely publicized on LKML (https://lkml.org/lkml/2012/11/12/545)
    and on LWN (http://lwn.net/Articles/541037/).

    This commit therefore removes TINY_PREEMPT_RCU.

    Signed-off-by: Paul E. McKenney
    [ paulmck: Updated to eliminate #else in rcutiny.h as suggested by Josh ]
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

29 May, 2013

1 commit

  • As rcu_dereference_raw() under RCU debug config options can add quite a
    bit of checks, and that tracing uses rcu_dereference_raw(), these checks
    happen with the function tracer. The function tracer also happens to trace
    these debug checks too. This added overhead can livelock the system.

    Add a new interface to RCU for both rcu_dereference_raw_notrace() as well
    as hlist_for_each_entry_rcu_notrace() as the hlist iterator uses the
    rcu_dereference_raw() as well, and is used a bit with the function tracer.

    Link: http://lkml.kernel.org/r/20130528184209.304356745@goodmis.org

    Acked-by: Paul E. McKenney
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

02 May, 2013

1 commit


19 Apr, 2013

1 commit

  • We need full dynticks CPU to also be RCU nocb so
    that we don't have to keep the tick to handle RCU
    callbacks.

    Make sure the range passed to nohz_full= boot
    parameter is a subset of rcu_nocbs=

    The CPUs that fail to meet this requirement will be
    excluded from the nohz_full range. This is checked
    early in boot time, before any CPU has the opportunity
    to stop its tick.

    Suggested-by: Steven Rostedt
    Reviewed-by: Paul E. McKenney
    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: Chris Metcalf
    Cc: Christoph Lameter
    Cc: Geoff Levand
    Cc: Gilad Ben Yossef
    Cc: Hakan Akkan
    Cc: Ingo Molnar
    Cc: Kevin Hilman
    Cc: Li Zhong
    Cc: Paul E. McKenney
    Cc: Paul Gortmaker
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner

    Frederic Weisbecker
     

26 Mar, 2013

1 commit

  • Because RCU callbacks are now associated with the number of the grace
    period that they must wait for, CPUs can now take advance callbacks
    corresponding to grace periods that ended while a given CPU was in
    dyntick-idle mode. This eliminates the need to try forcing the RCU
    state machine while entering idle, thus reducing the CPU intensiveness
    of RCU_FAST_NO_HZ, which should increase its energy efficiency.

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

    Paul E. McKenney
     

29 Jan, 2013

1 commit


27 Jan, 2013

1 commit


09 Jan, 2013

1 commit

  • Currently, rcutorture traces every read-side access. This can be
    problematic because even a two-minute rcutorture run on a two-CPU system
    can generate 28,853,363 reads. Normally, only a failing read is of
    interest, so this commit traces adjusts rcutorture's tracing to only
    trace failing reads. The resulting event tracing records the time
    and the ->completed value captured at the beginning of the RCU read-side
    critical section, allowing correlation with other event-tracing messages.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett
    [ paulmck: Add fix to build problem located by Randy Dunlap based on
    diagnosis by Steven Rostedt. ]

    Paul E. McKenney
     

01 Dec, 2012

1 commit

  • Create a new subsystem that probes on kernel boundaries
    to keep track of the transitions between level contexts
    with two basic initial contexts: user or kernel.

    This is an abstraction of some RCU code that use such tracking
    to implement its userspace extended quiescent state.

    We need to pull this up from RCU into this new level of indirection
    because this tracking is also going to be used to implement an "on
    demand" generic virtual cputime accounting. A necessary step to
    shutdown the tick while still accounting the cputime.

    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Li Zhong
    Cc: Gilad Ben-Yossef
    Reviewed-by: Steven Rostedt
    [ paulmck: fix whitespace error and email address. ]
    Signed-off-by: Paul E. McKenney

    Frederic Weisbecker
     

17 Nov, 2012

1 commit

  • …cu.2012.10.27a', 'stall.2012.11.13a', 'tracing.2012.11.08a' and 'idle.2012.10.24a' into HEAD

    urgent.2012.10.27a: Fix for RCU user-mode transition (already in -tip).

    doc.2012.11.08a: Documentation updates, most notably codifying the
    memory-barrier guarantees inherent to grace periods.

    fixes.2012.11.13a: Miscellaneous fixes.

    srcu.2012.10.27a: Allow statically allocated and initialized srcu_struct
    structures (courtesy of Lai Jiangshan).

    stall.2012.11.13a: Add more diagnostic information to RCU CPU stall
    warnings, also decrease from 60 seconds to 21 seconds.

    hotplug.2012.11.08a: Minor updates to CPU hotplug handling.

    tracing.2012.11.08a: Improved debugfs tracing, courtesy of Michael Wang.

    idle.2012.10.24a: Updates to RCU idle/adaptive-idle handling, including
    a boot parameter that maps normal grace periods to expedited.

    Resolved conflict in kernel/rcutree.c due to side-by-side change.

    Paul E. McKenney
     

14 Nov, 2012

1 commit

  • This commit explicitly states the memory-ordering properties of the
    RCU grace-period primitives. Although these properties were in some
    sense implied by the fundmental property of RCU ("a grace period must
    wait for all pre-existing RCU read-side critical sections to complete"),
    stating it explicitly will be a great labor-saving device.

    Reported-by: Oleg Nesterov
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Oleg Nesterov

    Paul E. McKenney
     

24 Oct, 2012

1 commit

  • It's only there to call rcu_user_hooks_switch(). Let's
    just call rcu_user_hooks_switch() directly, we don't need this
    function in the middle.

    Signed-off-by: Frederic Weisbecker
    Cc: Josh Triplett
    Cc: Peter Zijlstra
    Cc: Richard Weinberger
    Signed-off-by: Paul E. McKenney

    Frederic Weisbecker
     

26 Sep, 2012

4 commits

  • Clear the syscalls hook of a task when it's scheduled out so that if
    the task migrates, it doesn't run the syscall slow path on a CPU
    that might not need it.

    Also set the syscalls hook on the next task if needed.

    Signed-off-by: Frederic Weisbecker
    Cc: Alessio Igor Bogani
    Cc: Andrew Morton
    Cc: Avi Kivity
    Cc: Chris Metcalf
    Cc: Christoph Lameter
    Cc: Geoff Levand
    Cc: Gilad Ben Yossef
    Cc: Hakan Akkan
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Josh Triplett
    Cc: Kevin Hilman
    Cc: Max Krasnyansky
    Cc: Peter Zijlstra
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Cc: Sven-Thorsten Dietrich
    Cc: Thomas Gleixner
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Frederic Weisbecker
     
  • Create a new config option under the RCU menu that put
    CPUs under RCU extended quiescent state (as in dynticks
    idle mode) when they run in userspace. This require
    some contribution from architectures to hook into kernel
    and userspace boundaries.

    Signed-off-by: Frederic Weisbecker
    Cc: Alessio Igor Bogani
    Cc: Andrew Morton
    Cc: Avi Kivity
    Cc: Chris Metcalf
    Cc: Christoph Lameter
    Cc: Geoff Levand
    Cc: Gilad Ben Yossef
    Cc: Hakan Akkan
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Josh Triplett
    Cc: Kevin Hilman
    Cc: Max Krasnyansky
    Cc: Peter Zijlstra
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Cc: Sven-Thorsten Dietrich
    Cc: Thomas Gleixner
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Frederic Weisbecker
     
  • In some cases, it is necessary to enter or exit userspace-RCU-idle mode
    from an interrupt handler, for example, if some other CPU sends this
    CPU a resched IPI. In this case, the current CPU would enter the IPI
    handler in userspace-RCU-idle mode, but would need to exit the IPI handler
    after having exited that mode.

    To allow this to work, this commit adds two new APIs to TREE_RCU:

    - rcu_user_enter_after_irq(). This must be called from an interrupt between
    rcu_irq_enter() and rcu_irq_exit(). After the irq calls rcu_irq_exit(),
    the irq handler will return into an RCU extended quiescent state.
    In theory, this interrupt is never a nested interrupt, but in practice
    it might interrupt softirq, which looks to RCU like a nested interrupt.

    - rcu_user_exit_after_irq(). This must be called from a non-nesting
    interrupt, interrupting an RCU extended quiescent state, also
    between rcu_irq_enter() and rcu_irq_exit(). After the irq calls
    rcu_irq_exit(), the irq handler will return in an RCU non-quiescent
    state.

    [ Combined with "Allow calls to rcu_exit_user_irq from nesting irqs." ]

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

    Frederic Weisbecker
     
  • RCU currently insists that only idle tasks can enter RCU idle mode, which
    prohibits an adaptive tickless kernel (AKA nohz cpusets), which in turn
    would mean that usermode execution would always take scheduling-clock
    interrupts, even when there is only one task runnable on the CPU in
    question.

    This commit therefore adds rcu_user_enter() and rcu_user_exit(), which
    allow non-idle tasks to enter RCU idle mode. These are quite similar
    to rcu_idle_enter() and rcu_idle_exit(), respectively, except that they
    omit the idle-task checks.

    [ Updated to use "user" flag rather than separate check functions. ]

    [ paulmck: Updated to drop exports of new functions based on Josh's patch
    getting rid of the need for them. ]

    Signed-off-by: Frederic Weisbecker
    Signed-off-by: Paul E. McKenney
    Cc: Alessio Igor Bogani
    Cc: Andrew Morton
    Cc: Avi Kivity
    Cc: Chris Metcalf
    Cc: Christoph Lameter
    Cc: Daniel Lezcano
    Cc: Geoff Levand
    Cc: Gilad Ben Yossef
    Cc: Hakan Akkan
    Cc: Ingo Molnar
    Cc: Kevin Hilman
    Cc: Max Krasnyansky
    Cc: Peter Zijlstra
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Cc: Sven-Thorsten Dietrich
    Cc: Thomas Gleixner
    Reviewed-by: Josh Triplett

    Frederic Weisbecker
     

23 Sep, 2012

1 commit

  • There is a need to use RCU from interrupt context, but either before
    rcu_irq_enter() is called or after rcu_irq_exit() is called. If the
    interrupt occurs from idle, then lockdep-RCU will complain about such
    uses, as they appear to be illegal uses of RCU from the idle loop.
    In other environments, RCU_NONIDLE() could be used to properly protect
    the use of RCU, but RCU_NONIDLE() currently cannot be invoked except
    from process context.

    This commit therefore modifies RCU_NONIDLE() to permit its use more
    globally.

    Reported-by: Steven Rostedt
    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

06 Jul, 2012

2 commits

  • Although the C language allows you to break strings across lines, doing
    this makes it hard for people to find the Linux kernel code corresponding
    to a given console message. This commit therefore fixes broken strings
    throughout RCU's source code.

    Suggested-by: Josh Triplett
    Suggested-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • …a' and 'fnh.2012.07.02a' into HEAD

    bigrtm: First steps towards getting RCU out of the way of
    tens-of-microseconds real-time response on systems compiled
    with NR_CPUS=4096. Also cleanups for and increased concurrency
    of rcu_barrier() family of primitives.
    doctorture: rcutorture and documentation improvements.
    fixes: Miscellaneous fixes.
    fnh: RCU_FAST_NO_HZ fixes and improvements.

    Paul E. McKenney
     

03 Jul, 2012

8 commits

  • Commit d8169d4c (Make __kfree_rcu() less dependent on compiler choices)
    created a macro out of an inline function in order to avoid build
    breakage for certain combinations of gcc flags. Unfortunately, it also
    converted a kfree_call_rcu() to a call_rcu(), which made the rcu_data
    structure's ->qlen_lazy field lose counts. This commit therefore changes
    the call_rcu() back to kfree_call_rcu().

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

    Paul E. McKenney
     
  • Although __call_rcu() is handled correctly when called from a momentary
    non-idle period, if it is called on a CPU that RCU believes to be idle
    on RCU_FAST_NO_HZ kernels, the callback might be indefinitely postponed.
    This commit therefore ensures that RCU is aware of the new callback and
    has a chance to force the CPU out of dyntick-idle mode when a new callback
    is posted.

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

    Paul E. McKenney
     
  • Commit d8169d4c (Make __kfree_rcu() less dependent on compiler choices)
    added cpp macro versions of __kfree_rcu() and __is_kfree_rcu_offset(),
    but failed to remove the old inline-function versions. This commit does
    this cleanup.

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

    Paul E. McKenney
     
  • The CONFIG_TREE_PREEMPT_RCU and CONFIG_TINY_PREEMPT_RCU versions of
    __rcu_read_lock() and __rcu_read_unlock() are identical, so this commit
    consolidates them into kernel/rcupdate.h.

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

    Paul E. McKenney
     
  • The return value from rcu_assign_pointer() is not used, and using it
    would be quite ugly, for example:

    q = rcu_assign_pointer(global_p, p);

    To prevent this sort of ugliness from spreading, this commit wraps
    rcu_assign_pointer() in a do-while loop.

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

    Paul E. McKenney
     
  • The return value from RCU_INIT_POINTER() is not used, and using it
    would be quite ugly, for example:

    q = RCU_INIT_POINTER(global_p, p);

    To prevent this sort of ugliness from appearing, this commit wraps
    RCU_INIT_POINTER() in a do-while loop.

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

    Paul E. McKenney
     
  • RCU_INIT_POINTER() returns a value that is never used, and which should
    be abolished due to terminal ugliness:

    q = RCU_INIT_POINTER(global_p, p);

    However, there are two uses that cannot be handled by a do-while
    formulation because they do gcc-style initialization:

    RCU_INIT_POINTER(.real_cred, &init_cred),
    RCU_INIT_POINTER(.cred, &init_cred),

    This usage is clever, but not necessarily the nicest approach.
    This commit therefore creates an RCU_POINTER_INITIALIZER() macro that
    is specifically designed for gcc-style initialization.

    Signed-off-by: Paul E. McKenney
    Acked-by: David Howells

    Paul E. McKenney
     
  • This reverts commit 616c310e83b872024271c915c1b9ab505b9efad9.
    (Move PREEMPT_RCU preemption to switch_to() invocation).
    Testing by Sasha Levin showed that this
    can result in deadlock due to invoking the scheduler when one of
    the runqueue locks is held. Because this commit was simply a
    performance optimization, revert it.

    Reported-by: Sasha Levin
    Signed-off-by: Paul E. McKenney
    Tested-by: Sasha Levin

    Paul E. McKenney
     

12 May, 2012

1 commit

  • …and 'srcu.2012.05.07b' into HEAD

    barrier: Reduce the amount of disturbance by rcu_barrier() to the rest of
    the system. This branch also includes improvements to
    RCU_FAST_NO_HZ, which are included here due to conflicts.
    fixes: Miscellaneous fixes.
    inline: Remaining changes from an abortive attempt to inline
    preemptible RCU's __rcu_read_lock(). These are (1) making
    exit_rcu() avoid unnecessary work and (2) avoiding having
    preemptible RCU record a blocked thread when the scheduler
    declines to do a context switch.
    srcu: Lai Jiangshan's algorithmic implementation of SRCU, including
    call_srcu().

    Paul E. McKenney
     

03 May, 2012

2 commits

  • When running preemptible RCU, if a task exits in an RCU read-side
    critical section having blocked within that same RCU read-side critical
    section, the task must be removed from the list of tasks blocking a
    grace period (perhaps the current grace period, perhaps the next grace
    period, depending on timing). The exit() path invokes exit_rcu() to
    do this cleanup.

    However, the current implementation of exit_rcu() needlessly does the
    cleanup even if the task did not block within the current RCU read-side
    critical section, which wastes time and needlessly increases the size
    of the state space. Fix this by only doing the cleanup if the current
    task is actually on the list of tasks blocking some grace period.

    While we are at it, consolidate the two identical exit_rcu() functions
    into a single function.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Tested-by: Linus Torvalds

    Conflicts:

    kernel/rcupdate.c

    Paul E. McKenney
     
  • Currently, PREEMPT_RCU readers are enqueued upon entry to the scheduler.
    This is inefficient because enqueuing is required only if there is a
    context switch, and entry to the scheduler does not guarantee a context
    switch.

    The commit therefore moves the enqueuing to immediately precede the
    call to switch_to() from the scheduler.

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Tested-by: Linus Torvalds

    Paul E. McKenney
     

25 Apr, 2012

1 commit

  • Currently, __kfree_rcu() is implemented as an inline function, and
    contains a BUILD_BUG_ON() that malfunctions if __kfree_rcu() is compiled
    as an out-of-line function. Unfortunately, there are compiler settings
    (e.g., -O0) that can result in __kfree_rcu() being compiled out of line,
    resulting in annoying build breakage. This commit therefore converts
    both __kfree_rcu() and __is_kfree_rcu_offset() from inline functions to
    macros to prevent such misbehavior on the part of the compiler.

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

    Jan Engelhardt
     

25 Mar, 2012

1 commit

  • Pull cleanup from Paul Gortmaker:
    "The changes shown here are to unify linux's BUG support under the one
    file. Due to historical reasons, we have some BUG code
    in bug.h and some in kernel.h -- i.e. the support for BUILD_BUG in
    linux/kernel.h predates the addition of linux/bug.h, but old code in
    kernel.h wasn't moved to bug.h at that time. As a band-aid, kernel.h
    was including to pseudo link them.

    This has caused confusion[1] and general yuck/WTF[2] reactions. Here
    is an example that violates the principle of least surprise:

    CC lib/string.o
    lib/string.c: In function 'strlcat':
    lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
    make[2]: *** [lib/string.o] Error 1
    $
    $ grep linux/bug.h lib/string.c
    #include
    $

    We've included for the BUG infrastructure and yet we
    still get a compile fail! [We've not kernel.h for BUILD_BUG_ON.] Ugh -
    very confusing for someone who is new to kernel development.

    With the above in mind, the goals of this changeset are:

    1) find and fix any include/*.h files that were relying on the
    implicit presence of BUG code.
    2) find and fix any C files that were consuming kernel.h and hence
    relying on implicitly getting some/all BUG code.
    3) Move the BUG related code living in kernel.h to
    4) remove the asm/bug.h from kernel.h to finally break the chain.

    During development, the order was more like 3-4, build-test, 1-2. But
    to ensure that git history for bisect doesn't get needless build
    failures introduced, the commits have been reorderd to fix the problem
    areas in advance.

    [1] https://lkml.org/lkml/2012/1/3/90
    [2] https://lkml.org/lkml/2012/1/17/414"

    Fix up conflicts (new radeon file, reiserfs header cleanups) as per Paul
    and linux-next.

    * tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    kernel.h: doesn't explicitly use bug.h, so don't include it.
    bug: consolidate BUILD_BUG_ON with other bug code
    BUG: headers with BUG/BUG_ON etc. need linux/bug.h
    bug.h: add include of it to various implicit C users
    lib: fix implicit users of kernel.h for TAINT_WARN
    spinlock: macroize assert_spin_locked to avoid bug.h dependency
    x86: relocate get/set debugreg fcns to include/asm/debugreg.

    Linus Torvalds
     

24 Mar, 2012

1 commit

  • Due to the alignment of following variables, these typically consume
    more than just the single byte that 'bool' requires, and as there are a
    few hundred instances, the cache pollution (not so much the waste of
    memory) sums up. Put these variables into their own section, outside of
    any half way frequently used memory range.

    Do the same also to the __warned variable of rcu_lockdep_assert().
    (Don't, however, include the ones used by printk_once() and alike, as
    they can potentially be hot.)

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     

05 Mar, 2012

1 commit

  • If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
    other BUG variant in a static inline (i.e. not in a #define) then
    that header really should be including and not just
    expecting it to be implicitly present.

    We can make this change risk-free, since if the files using these
    headers didn't have exposure to linux/bug.h already, they would have
    been causing compile failures/warnings.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

22 Feb, 2012

4 commits

  • RCU, RCU-bh, and RCU-sched read-side critical sections are forbidden
    in the inner idle loop, that is, between the rcu_idle_enter() and the
    rcu_idle_exit() -- RCU will happily ignore any such read-side critical
    sections. However, things like powertop need tracepoints in the inner
    idle loop.

    This commit therefore provides an RCU_NONIDLE() macro that can be used to
    wrap code in the idle loop that requires RCU read-side critical sections.

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

    Paul E. McKenney
     
  • The WARN_ON_ONCE() in rcu_lock_acquire() results in infinite recursion
    on S390, and also doesn't print very much information. Remove this.

    Updated patch to add lockdep-RCU assertions to RCU's read-side primitives.

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

    Heiko Carstens
     
  • Although it is legal to use RCU during early boot, it is anything
    but legal to use RCU at runtime from an offlined CPU. After all, RCU
    explicitly ignores offlined CPUs. This commit therefore adds checks
    for runtime use of RCU from offlined CPUs.

    These checks are not perfect, in particular, they can be subverted
    through use of things like rcu_dereference_raw(). Note that it is not
    possible to put checks in rcu_read_lock() and friends due to the fact
    that these primitives are used in code that might be used under either
    RCU or lock-based protection, which means that checking rcu_read_lock()
    gets you fat piles of false positives.

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

    Paul E. McKenney
     
  • There is no convenient expression for rcu_deference_protected()
    when it is used in tearing down multilinked structures following
    a grace period. For example, suppose that an element containing an
    RCU-protected pointer to a second element is removed from an enclosing
    RCU-protected data structure, then the write-side lock is released,
    and finally synchronize_rcu() is invoked to wait for a grace period.
    Then it is necessary to traverse the pointer in order to free up the
    second element. But we are not in an RCU read-side critical section
    and we are holding no locks, so the usual rcu_dereference_check() and
    rcu_dereference_protected() primitives are not appropriate. Neither
    is rcu_dereference_raw(), as it is intended for use in data structures
    where the user defines the locking design (for example, list_head).

    So this responsibility is added to rcu_access_pointer()'s list, and
    this commit updates rcu_assign_pointer()'s header comment accordingly.

    Suggested-by: David Howells
    Signed-off-by: Paul E. McKenney
    Acked-by: David Howells

    Paul E. McKenney