29 Jan, 2013

2 commits

  • …' and 'tiny.2013.01.29b' into HEAD

    doctorture.2013.01.11a: Changes to rcutorture and to RCU documentation.

    fixes.2013.01.26a: Miscellaneous fixes.

    tagcb.2013.01.24a: Tag RCU callbacks with grace-period number to
    simplify callback advancement.

    tiny.2013.01.29b: Enhancements to uniprocessor handling in tiny RCU.

    Paul E. McKenney
     
  • 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
     

27 Jan, 2013

2 commits


09 Jan, 2013

5 commits

  • This commit adds event tracing for callback acceleration to allow better
    tracking of callbacks through the system.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Currently, callbacks are advanced each time the corresponding CPU
    notices a change in its leaf rcu_node structure's ->completed value
    (this value counts grace-period completions). This approach has worked
    quite well, but with the advent of RCU_FAST_NO_HZ, we cannot count on
    a given CPU seeing all the grace-period completions. When a CPU misses
    a grace-period completion that occurs while it is in dyntick-idle mode,
    this will delay invocation of its callbacks.

    In addition, acceleration of callbacks (when RCU realizes that a given
    callback need only wait until the end of the next grace period, rather
    than having to wait for a partial grace period followed by a full
    grace period) must be carried out extremely carefully. Insufficient
    acceleration will result in unnecessarily long grace-period latencies,
    while excessive acceleration will result in premature callback invocation.
    Changes that involve this tradeoff are therefore among the most
    nerve-wracking changes to RCU.

    This commit therefore explicitly tags groups of callbacks with the
    number of the grace period that they are waiting for. This means that
    callback-advancement and callback-acceleration functions are idempotent,
    so that excessive acceleration will merely waste a few CPU cycles. This
    also allows a CPU to take full advantage of any grace periods that have
    elapsed while it has been in dyntick-idle mode. It should also enable
    simulataneous simplifications to and optimizations of RCU_FAST_NO_HZ.

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

    Paul E. McKenney
     
  • It turns out that gcc 4.8 warns on array indexes being out of bounds
    unless it can prove otherwise. It gives this warning on some RCU
    initialization code. Because this is far from any fastpath, add
    an explicit check for array bounds and panic if so. This gives the
    compiler enough information to figure out that the array index is never
    out of bounds.

    However, if a similar false positive occurs on a fastpath, it will
    probably be necessary to tell the compiler to keep its array-index
    anxieties to itself. ;-)

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

    Paul E. McKenney
     
  • This patch uses the real new value of dynticks_nesting instead of 0 in
    rcu_eqs_enter_common().

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

    Li Zhong
     
  • Both rcutiny and rcutree define a helper function named
    rcu_is_cpu_rrupt_from_idle(), each used exactly once, later in the
    same file. This commit therefore declares these helper functions static.

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

    Josh Triplett
     

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

2 commits

  • RCU callback execution can add significant OS jitter and also can
    degrade both scheduling latency and, in asymmetric multiprocessors,
    energy efficiency. This commit therefore adds the ability for selected
    CPUs ("rcu_nocbs=" boot parameter) to have their callbacks offloaded
    to kthreads. If the "rcu_nocb_poll" boot parameter is also specified,
    these kthreads will do polling, removing the need for the offloaded
    CPUs to do wakeups. At least one CPU must be doing normal callback
    processing: currently CPU 0 cannot be selected as a no-CBs CPU.
    In addition, attempts to offline the last normal-CBs CPU will fail.

    This feature was inspired by Jim Houston's and Joe Korty's JRCU, and
    this commit includes fixes to problems located by Fengguang Wu's
    kbuild test robot.

    [ paulmck: Added gfp.h include file as suggested by Fengguang Wu. ]

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

    Paul E. McKenney
     
  • …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

2 commits

  • 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
     
  • Commit 29c00b4a1d9e27 (rcu: Add event-tracing for RCU callback
    invocation) added a regression in rcu_do_batch()

    Under stress, RCU is supposed to allow to process all items in queue,
    instead of a batch of 10 items (blimit), but an integer overflow makes
    the effective limit being 1. So, unless there is frequent idle periods
    (during which RCU ignores batch limits), RCU can be forced into a
    state where it cannot keep up with the callback-generation rate,
    eventually resulting in OOM.

    This commit therefore converts a few variables in rcu_do_batch() from
    int to long to fix this problem, along with the module parameters
    controlling the batch limits.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Paul E. McKenney
    Cc: # 3.2 +

    Eric Dumazet
     

09 Nov, 2012

5 commits

  • The rcu_state structure's ->completed field is unsigned long, so this
    commit adjusts show_one_rcugp()'s printf() format to suit. Also add
    the required ACCESS_ONCE() directives while we are in this function.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit adds the counters to rcu_state and updates them in
    synchronize_rcu_expedited() to provide the data needed for debugfs
    tracing.

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

    Paul E. McKenney
     
  • Tracing (debugfs) of expedited RCU primitives is required, which in turn
    requires that the relevant data be located where the tracing code can find
    it, not in its current static global variables in kernel/rcutree.c.
    This commit therefore moves sync_sched_expedited_started and
    sync_sched_expedited_done to the rcu_state structure, as fields
    ->expedited_start and ->expedited_done, respectively.

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

    Paul E. McKenney
     
  • There is a counter scheme similar to ticket locking that
    synchronize_sched_expedited() uses to service multiple concurrent
    callers with the same expedited grace period. Upon entry, a
    sync_sched_expedited_started variable is atomically incremented,
    and upon completion of a expedited grace period a separate
    sync_sched_expedited_done variable is atomically incremented.

    However, if a synchronize_sched_expedited() is delayed while
    in try_stop_cpus(), concurrent invocations will increment the
    sync_sched_expedited_started counter, which will eventually overflow.
    If the original synchronize_sched_expedited() resumes execution just
    as the counter overflows, a concurrent invocation could incorrectly
    conclude that an expedited grace period elapsed in zero time, which
    would be bad. One could rely on counter size to prevent this from
    happening in practice, but the goal is to formally validate this
    code, so it needs to be fixed anyway.

    This commit therefore checks the gap between the two counters before
    incrementing sync_sched_expedited_started, and if the gap is too
    large, does a normal grace period instead. Overflow is thus only
    possible if there are more than about 3.5 billion threads on 32-bit
    systems, which can be excluded until such time as task_struct fits
    into a single byte and 4G/4G patches are accepted into mainline.
    It is also easy to encode this limitation into mechanical theorem
    provers.

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

    Paul E. McKenney
     
  • The ->onofflock field in the rcu_state structure at one time synchronized
    CPU-hotplug operations for RCU. However, its scope has decreased over time
    so that it now only protects the lists of orphaned RCU callbacks. This
    commit therefore renames it to ->orphan_lock to reflect its current use.

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

    Paul E. McKenney
     

24 Oct, 2012

6 commits

  • In theory, if a grace period manages to get started despite there being
    no callbacks on any of the CPUs, all CPUs could go into dyntick-idle
    mode, so that the grace period would never end. This commit updates
    the RCU CPU stall warning messages to detect this condition by summing
    up the number of callbacks on all CPUs.

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

    Paul E. McKenney
     
  • This commit causes the last grace period started and completed to be
    printed on RCU CPU stall warning messages in order to aid diagnosis.

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

    Paul E. McKenney
     
  • The RCU CPU stall warnings rely on trigger_all_cpu_backtrace() to
    do NMI-based dump of the stack traces of all CPUs. Unfortunately, a
    number of architectures do not implement trigger_all_cpu_backtrace(), in
    which case RCU falls back to just dumping the stack of the running CPU.
    This is unhelpful in the case where the running CPU has detected that
    some other CPU has stalled.

    This commit therefore makes the running CPU dump the stacks of the
    tasks running on the stalled CPUs.

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

    Paul E. McKenney
     
  • The fix introduced by a10d206e (rcu: Fix day-one dyntick-idle
    stall-warning bug) has a C-language precedence error. It turns out
    that this error is harmless in that the same result is computed for all
    inputs, but the code is nevertheless a potential source of confusion.
    This commit therefore introduces parentheses in order to force the
    execution of the code to reflect the intent.

    Reported-by: Ben Hutchings
    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • 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
     
  • In the old days, _rcu_barrier() acquired ->onofflock to exclude
    rcu_send_cbs_to_orphanage(), which allowed the latter to avoid memory
    barriers in callback handling. However, _rcu_barrier() recently started
    doing get_online_cpus() to lock out CPU-hotplug operations entirely, which
    means that the comment in rcu_send_cbs_to_orphanage() that talks about
    ->onofflock is now obsolete. This commit therefore fixes the comment.

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

    Paul E. McKenney
     

21 Oct, 2012

1 commit

  • Because grace-period initialization is carried out by a separate
    kthread, it might happen on a different CPU than the one that
    had the callback needing a grace period -- which is where the
    callback acceleration needs to happen.

    Fortunately, rcu_start_gp() holds the root rcu_node structure's
    ->lock, which prevents a new grace period from starting. This
    allows this function to safely determine that a grace period has
    not yet started, which in turn allows it to fully accelerate any
    callbacks that it has pending. This commit adds this acceleration.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

09 Oct, 2012

1 commit

  • Kirill noted the following deadlock cycle on shutdown involving padata:

    > With commit 755609a9087fa983f567dc5452b2fa7b089b591f I've got deadlock on
    > poweroff.
    >
    > It guess it happens because of race for cpu_hotplug.lock:
    >
    > CPU A CPU B
    > disable_nonboot_cpus()
    > _cpu_down()
    > cpu_hotplug_begin()
    > mutex_lock(&cpu_hotplug.lock);
    > __cpu_notify()
    > padata_cpu_callback()
    > __padata_remove_cpu()
    > padata_replace()
    > synchronize_rcu()
    > rcu_gp_kthread()
    > get_online_cpus();
    > mutex_lock(&cpu_hotplug.lock);

    It would of course be good to eliminate grace-period delays from
    CPU-hotplug notifiers, but that is a separate issue. Deadlock is
    not an appropriate diagnostic for excessive CPU-hotplug latency.

    Fortunately, grace-period initialization does not actually need to
    exclude all of the CPU-hotplug operation, but rather only RCU's own
    CPU_UP_PREPARE and CPU_DEAD CPU-hotplug notifiers. This commit therefore
    introduces a new per-rcu_state onoff_mutex that provides the required
    concurrency control in place of the get_online_cpus() that was previously
    in rcu_gp_init().

    Reported-by: "Kirill A. Shutemov"
    Signed-off-by: Paul E. McKenney
    Tested-by: Kirill A. Shutemov

    Paul E. McKenney
     

26 Sep, 2012

9 commits

  • Checking "user" before "is_idle_task()" allows better optimizations
    in cases where inlining is possible. Also, "bool" should be passed
    "true" or "false" rather than "1" or "0". This commit therefore makes
    these changes, as noted in Josh's review.

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

    Paul E. McKenney
     
  • Provide a config option that enables the userspace
    RCU extended quiescent state on every CPUs by default.

    This is for testing purpose.

    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
     
  • 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
     
  • By default we don't want to enter into RCU extended quiescent
    state while in userspace because doing this produces some overhead
    (eg: use of syscall slowpath). Set it off by default and ready to
    run when some feature like adaptive tickless need it.

    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
     
  • Allow calls to rcu_user_enter() even if we are already
    in userspace (as seen by RCU) and allow calls to rcu_user_exit()
    even if we are already in the kernel.

    This makes the APIs more flexible to be called from architectures.
    Exception entries for example won't need to know if they come from
    userspace before calling rcu_user_exit().

    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
     
  • The conflicts between kernel/rcutree.h and kernel/rcutree_plugin.h
    were due to adjacent insertions and deletions, which were resolved
    by simply accepting the changes on both branches.

    Paul E. McKenney
     

25 Sep, 2012

1 commit

  • …', 'hotplug.2012.09.23a' and 'idlechop.2012.09.23a' into HEAD

    bigrt.2012.09.23a contains additional commits to reduce scheduling latency
    from RCU on huge systems (many hundrends or thousands of CPUs).

    doctorture.2012.09.23a contains documentation changes and rcutorture fixes.

    fixes.2012.09.23a contains miscellaneous fixes.

    hotplug.2012.09.23a contains CPU-hotplug-related changes.

    idle.2012.09.23a fixes architectures for which RCU no longer considered
    the idle loop to be a quiescent state due to earlier
    adaptive-dynticks changes. Affected architectures are alpha,
    cris, frv, h8300, m32r, m68k, mn10300, parisc, score, xtensa,
    and ia64.

    Paul E. McKenney
     

23 Sep, 2012

3 commits

  • Posting a callback after the CPU_DEAD notifier effectively leaks
    that callback unless/until that CPU comes back online. Silence is
    unhelpful when attempting to track down such leaks, so this commit emits
    a WARN_ON_ONCE() and unconditionally leaks the callback when an offline
    CPU attempts to register a callback. The rdp->nxttail[RCU_NEXT_TAIL] is
    set to NULL in the CPU_DEAD notifier and restored in the CPU_UP_PREPARE
    notifier, allowing _call_rcu() to determine exactly when posting callbacks
    is illegal.

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

    Paul E. McKenney
     
  • Currently, _rcu_barrier() relies on preempt_disable() to prevent
    any CPU from going offline, which in turn depends on CPU hotplug's
    use of __stop_machine().

    This patch therefore makes _rcu_barrier() use get_online_cpus() to
    block CPU-hotplug operations. This has the added benefit of removing
    the need for _rcu_barrier() to adopt callbacks: Because CPU-hotplug
    operations are excluded, there can be no callbacks to adopt. This
    commit simplifies the code accordingly.

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

    Paul E. McKenney
     
  • The first memory barrier in __call_rcu() is supposed to order any
    updates done beforehand by the caller against the actual queuing
    of the callback. However, the second memory barrier (which is intended
    to order incrementing the queue lengths before queuing the callback)
    is also between the caller's updates and the queuing of the callback.
    The second memory barrier can therefore serve both purposes.

    This commit therefore removes the first memory barrier.

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

    Paul E. McKenney