30 Jul, 2016

1 commit

  • Pull smp hotplug updates from Thomas Gleixner:
    "This is the next part of the hotplug rework.

    - Convert all notifiers with a priority assigned

    - Convert all CPU_STARTING/DYING notifiers

    The final removal of the STARTING/DYING infrastructure will happen
    when the merge window closes.

    Another 700 hundred line of unpenetrable maze gone :)"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    timers/core: Correct callback order during CPU hot plug
    leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
    powerpc/numa: Convert to hotplug state machine
    arm/perf: Fix hotplug state machine conversion
    irqchip/armada: Avoid unused function warnings
    ARC/time: Convert to hotplug state machine
    clocksource/atlas7: Convert to hotplug state machine
    clocksource/armada-370-xp: Convert to hotplug state machine
    clocksource/exynos_mct: Convert to hotplug state machine
    clocksource/arm_global_timer: Convert to hotplug state machine
    rcu: Convert rcutree to hotplug state machine
    KVM/arm/arm64/vgic-new: Convert to hotplug state machine
    smp/cfd: Convert core to hotplug state machine
    x86/x2apic: Convert to CPU hotplug state machine
    profile: Convert to hotplug state machine
    timers/core: Convert to hotplug state machine
    hrtimer: Convert to hotplug state machine
    x86/tboot: Convert to hotplug state machine
    arm64/armv8 deprecated: Convert to hotplug state machine
    hwtracing/coresight-etm4x: Convert to hotplug state machine
    ...

    Linus Torvalds
     

26 Jul, 2016

1 commit

  • Pull locking updates from Ingo Molnar:
    "The locking tree was busier in this cycle than the usual pattern - a
    couple of major projects happened to coincide.

    The main changes are:

    - implement the atomic_fetch_{add,sub,and,or,xor}() API natively
    across all SMP architectures (Peter Zijlstra)

    - add atomic_fetch_{inc/dec}() as well, using the generic primitives
    (Davidlohr Bueso)

    - optimize various aspects of rwsems (Jason Low, Davidlohr Bueso,
    Waiman Long)

    - optimize smp_cond_load_acquire() on arm64 and implement LSE based
    atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    on arm64 (Will Deacon)

    - introduce smp_acquire__after_ctrl_dep() and fix various barrier
    mis-uses and bugs (Peter Zijlstra)

    - after discovering ancient spin_unlock_wait() barrier bugs in its
    implementation and usage, strengthen its semantics and update/fix
    usage sites (Peter Zijlstra)

    - optimize mutex_trylock() fastpath (Peter Zijlstra)

    - ... misc fixes and cleanups"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (67 commits)
    locking/atomic: Introduce inc/dec variants for the atomic_fetch_$op() API
    locking/barriers, arch/arm64: Implement LDXR+WFE based smp_cond_load_acquire()
    locking/static_keys: Fix non static symbol Sparse warning
    locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec()
    locking/atomic, arch/tile: Fix tilepro build
    locking/atomic, arch/m68k: Remove comment
    locking/atomic, arch/arc: Fix build
    locking/Documentation: Clarify limited control-dependency scope
    locking/atomic, arch/rwsem: Employ atomic_long_fetch_add()
    locking/atomic, arch/qrwlock: Employ atomic_fetch_add_acquire()
    locking/atomic, arch/mips: Convert to _relaxed atomics
    locking/atomic, arch/alpha: Convert to _relaxed atomics
    locking/atomic: Remove the deprecated atomic_{set,clear}_mask() functions
    locking/atomic: Remove linux/atomic.h:atomic_fetch_or()
    locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    locking/atomic: Fix atomic64_relaxed() bits
    locking/atomic, arch/xtensa: Implement atomic_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/x86: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/tile: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/sparc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    ...

    Linus Torvalds
     

15 Jul, 2016

1 commit

  • Straight forward conversion to the state machine. Though the question arises
    whether this needs really all these state transitions to work.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153337.982013161@linutronix.de
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

16 Jun, 2016

5 commits

  • doc.2016.06.15a: Documentation updates
    fixes.2016.06.15b: Documentation updates
    torture.2016.06.14a: Documentation updates

    Paul E. McKenney
     
  • In many cases in the RCU tree code, we iterate over the set of cpus for
    a leaf node described by rcu_node::grplo and rcu_node::grphi, checking
    per-cpu data for each cpu in this range. However, if the set of possible
    cpus is sparse, some cpus described in this range are not possible, and
    thus no per-cpu region will have been allocated (or initialised) for
    them by the generic percpu code.

    Erroneous accesses to a per-cpu area for these !possible cpus may fault
    or may hit other data depending on the addressed generated when the
    erroneous per cpu offset is applied. In practice, both cases have been
    observed on arm64 hardware (the former being silent, but detectable with
    additional patches).

    To avoid issues resulting from this, we must iterate over the set of
    *possible* cpus for a given leaf node. This patch add a new helper,
    for_each_leaf_node_possible_cpu, to enable this. As iteration is often
    intertwined with rcu_node local bitmask manipulation, a new
    leaf_node_cpu_bit helper is added to make this simpler and more
    consistent. The RCU tree code is made to use both of these where
    appropriate.

    Without this patch, running reboot at a shell can result in an oops
    like:

    [ 3369.075979] Unable to handle kernel paging request at virtual address ffffff8008b21b4c
    [ 3369.083881] pgd = ffffffc3ecdda000
    [ 3369.087270] [ffffff8008b21b4c] *pgd=00000083eca48003, *pud=00000083eca48003, *pmd=0000000000000000
    [ 3369.096222] Internal error: Oops: 96000007 [#1] PREEMPT SMP
    [ 3369.101781] Modules linked in:
    [ 3369.104825] CPU: 2 PID: 1817 Comm: NetworkManager Tainted: G W 4.6.0+ #3
    [ 3369.121239] task: ffffffc0fa13e000 ti: ffffffc3eb940000 task.ti: ffffffc3eb940000
    [ 3369.128708] PC is at sync_rcu_exp_select_cpus+0x188/0x510
    [ 3369.134094] LR is at sync_rcu_exp_select_cpus+0x104/0x510
    [ 3369.139479] pc : [] lr : [] pstate: 200001c5
    [ 3369.146860] sp : ffffffc3eb9435a0
    [ 3369.150162] x29: ffffffc3eb9435a0 x28: ffffff8008be4f88
    [ 3369.155465] x27: ffffff8008b66c80 x26: ffffffc3eceb2600
    [ 3369.160767] x25: 0000000000000001 x24: ffffff8008be4f88
    [ 3369.166070] x23: ffffff8008b51c3c x22: ffffff8008b66c80
    [ 3369.171371] x21: 0000000000000001 x20: ffffff8008b21b40
    [ 3369.176673] x19: ffffff8008b66c80 x18: 0000000000000000
    [ 3369.181975] x17: 0000007fa951a010 x16: ffffff80086a30f0
    [ 3369.187278] x15: 0000007fa9505590 x14: 0000000000000000
    [ 3369.192580] x13: ffffff8008b51000 x12: ffffffc3eb940000
    [ 3369.197882] x11: 0000000000000006 x10: ffffff8008b51b78
    [ 3369.203184] x9 : 0000000000000001 x8 : ffffff8008be4000
    [ 3369.208486] x7 : ffffff8008b21b40 x6 : 0000000000001003
    [ 3369.213788] x5 : 0000000000000000 x4 : ffffff8008b27280
    [ 3369.219090] x3 : ffffff8008b21b4c x2 : 0000000000000001
    [ 3369.224406] x1 : 0000000000000001 x0 : 0000000000000140
    ...
    [ 3369.972257] [] sync_rcu_exp_select_cpus+0x188/0x510
    [ 3369.978685] [] synchronize_rcu_expedited+0x64/0xa8
    [ 3369.985026] [] synchronize_net+0x24/0x30
    [ 3369.990499] [] dev_deactivate_many+0x28c/0x298
    [ 3369.996493] [] __dev_close_many+0x60/0xd0
    [ 3370.002052] [] __dev_close+0x28/0x40
    [ 3370.007178] [] __dev_change_flags+0x8c/0x158
    [ 3370.012999] [] dev_change_flags+0x20/0x60
    [ 3370.018558] [] do_setlink+0x288/0x918
    [ 3370.023771] [] rtnl_newlink+0x398/0x6a8
    [ 3370.029158] [] rtnetlink_rcv_msg+0xe4/0x220
    [ 3370.034891] [] netlink_rcv_skb+0xc4/0xf8
    [ 3370.040364] [] rtnetlink_rcv+0x2c/0x40
    [ 3370.045663] [] netlink_unicast+0x160/0x238
    [ 3370.051309] [] netlink_sendmsg+0x2f0/0x358
    [ 3370.056956] [] sock_sendmsg+0x18/0x30
    [ 3370.062168] [] ___sys_sendmsg+0x26c/0x280
    [ 3370.067728] [] __sys_sendmsg+0x44/0x88
    [ 3370.073027] [] SyS_sendmsg+0x10/0x20
    [ 3370.078153] [] el0_svc_naked+0x24/0x28

    Signed-off-by: Mark Rutland
    Reported-by: Dennis Chen
    Cc: Catalin Marinas
    Cc: Josh Triplett
    Cc: Lai Jiangshan
    Cc: Mathieu Desnoyers
    Cc: Steve Capper
    Cc: Steven Rostedt
    Cc: Will Deacon
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Paul E. McKenney

    Mark Rutland
     
  • It is not always easy to determine the cause of an RCU stall just by
    analysing the RCU stall messages, mainly when the problem is caused
    by the indirect starvation of rcu threads. For example, when preempt_rcu
    is not awakened due to the starvation of a timer softirq.

    We have been hard coding panic() in the RCU stall functions for
    some time while testing the kernel-rt. But this is not possible in
    some scenarios, like when supporting customers.

    This patch implements the sysctl kernel.panic_on_rcu_stall. If
    set to 1, the system will panic() when an RCU stall takes place,
    enabling the capture of a vmcore. The vmcore provides a way to analyze
    all kernel/tasks states, helping out to point to the culprit and the
    solution for the stall.

    The kernel.panic_on_rcu_stall sysctl is disabled by default.

    Changes from v1:
    - Fixed a typo in the git log
    - The if(sysctl_panic_on_rcu_stall) panic() is in a static function
    - Fixed the CONFIG_TINY_RCU compilation issue
    - The var sysctl_panic_on_rcu_stall is now __read_mostly

    Cc: Jonathan Corbet
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Steven Rostedt
    Cc: Mathieu Desnoyers
    Cc: Lai Jiangshan
    Acked-by: Christian Borntraeger
    Reviewed-by: Josh Triplett
    Reviewed-by: Arnaldo Carvalho de Melo
    Tested-by: "Luis Claudio R. Goncalves"
    Signed-off-by: Daniel Bristot de Oliveira
    Signed-off-by: Paul E. McKenney

    Daniel Bristot de Oliveira
     
  • In the area in hot pursuit of a bug, so might as well clean it up.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Currently, if the very first call to call_rcu_tasks() has irqs disabled,
    it will create the rcu_tasks_kthread with irqs disabled, which will
    result in a splat in the memory allocator, which kthread_run() invokes
    with the expectation that irqs are enabled.

    This commit fixes this problem by deferring kthread creation if called
    with irqs disabled. The first call to call_rcu_tasks() that has irqs
    enabled will create the kthread.

    This bug was detected by rcutorture changes that were motivated by
    Iftekhar Ahmed's mutation-testing efforts.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

15 Jun, 2016

9 commits

  • Fix to return a negative error code -ENOMEM from kcalloc() error
    handling case instead of 0, as done elsewhere in this function.

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

    Wei Yongjun
     
  • 0day found a boot warning triggered in rcu_perf_writer() on !SMP kernel:

    WARN_ON(rcu_gp_is_normal() && gp_exp);

    , the root cause of which is trying to measure expedited grace
    periods(by setting gp_exp to true by default) when all the grace periods
    are normal(TINY RCU only has normal grace periods).

    However, such a mis-setting would only result in failing to measure the
    performance for a specific kind of grace periods, therefore using a
    WARN_ON to check this is a little overkilling. We could handle this
    inside rcuperf module via some error messages to tell users about the
    mis-settings.

    Therefore this patch removes the WARN_ON in rcu_perf_writer() and
    handles those checkings in rcu_perf_init() with plain if() code.

    Moreover, this patch changes the default value of gp_exp to 1) align
    with rcutorture tests and 2) make the default setting work for all RCU
    implementations by default.

    Suggested-by: Paul E. McKenney
    Signed-off-by: Boqun Feng
    Fixes: http://lkml.kernel.org/r/57411b10.mFvG0+AgcrMXGtcj%fengguang.wu@intel.com
    Signed-off-by: Paul E. McKenney

    Boqun Feng
     
  • This commit removes CONFIG_RCU_TORTURE_TEST_RUNNABLE in favor of the
    already-existing rcutorture.torture_runnable kernel boot parameter.
    It also converts an #ifdef into IS_ENABLED(), saving a few lines of code.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit applies the infamous IS_ENABLED() macro to eliminate a #ifdef.
    It also eliminates the RCU_PERF_TEST_RUNNABLE Kconfig option in favor
    of the already-existing rcuperf.perf_runnable kernel boot parameter.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • People have been having some difficulty finding their way around the
    RCU code. This commit therefore pulls some of the expedited grace-period
    code from tree_plugin.h to a new tree_exp.h file. This commit is strictly
    code movement.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • People have been having some difficulty finding their way around the
    RCU code. This commit therefore pulls some of the expedited grace-period
    code from tree.c to a new tree_exp.h file. This commit is strictly code
    movement, with the exception of a forward declaration that was added
    for the sync_sched_exp_online_cleanup() function.

    A subsequent commit will move the remaining expedited grace-period code
    from tree_plugin.h to tree_exp.h.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • I think you'll find this condition is superfluous, as the whole function
    is under #ifdef of that same.

    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Paul E. McKenney

    Peter Zijlstra
     
  • In the past, RCU grace-period initialization excluded CPU-hotplug
    operations, but this is no longer the case. This commit therefore
    removed an outdated comment in rcu_gp_init() claiming that these
    are excluded.

    Reported-by: Lihao Liang
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The comment header for rcu_scheduler_active states that it is used
    to optimize synchronize_sched() at early boot. This is incorrect.
    The synchronize_sched() function instead checks the number of online
    CPUs. This commit therefore replaces the comment's synchronize_sched()
    with synchronize_rcu(), which really does use rcu_scheduler_active for
    this purpose.

    Reported-by: Lihao Liang
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

08 Jun, 2016

1 commit

  • A while back Viro posted a number of 'interesting' mutex_is_locked()
    users on IRC, one of those was RCU.

    RCU seems to use mutex_is_locked() to avoid doing mutex_trylock(), the
    regular load before modify pattern.

    While the use isn't wrong per se, its curious in that its needed at all,
    mutex_trylock() should be good enough on its own to avoid the pointless
    cacheline bounces.

    So fix those and remove the mutex_is_locked() (ab)use from RCU.

    Reported-by: Al Viro
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Paul McKenney
    Acked-by: Davidlohr Bueso
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Waiman Long
    Link: http://lkml.kernel.org/r/20160601185815.GW3190@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

20 May, 2016

2 commits

  • When activating a static object we need make sure that the object is
    tracked in the object tracker. If it is a non-static object then the
    activation is illegal.

    In previous implementation, each subsystem need take care of this in
    their fixup callbacks. Actually we can put it into debugobjects core.
    Thus we can save duplicated code, and have *pure* fixup callbacks.

    To achieve this, a new callback "is_static_object" is introduced to let
    the type specific code decide whether a object is static or not. If
    yes, we take it into object tracker, otherwise give warning and invoke
    fixup callback.

    This change has paassed debugobjects selftest, and I also do some test
    with all debugobjects supports enabled.

    At last, I have a concern about the fixups that can it change the object
    which is in incorrect state on fixup? Because the 'addr' may not point
    to any valid object if a non-static object is not tracked. Then Change
    such object can overwrite someone's memory and cause unexpected
    behaviour. For example, the timer_fixup_activate bind timer to function
    stub_timer.

    Link: http://lkml.kernel.org/r/1462576157-14539-1-git-send-email-changbin.du@intel.com
    [changbin.du@intel.com: improve code comments where invoke the new is_static_object callback]
    Link: http://lkml.kernel.org/r/1462777431-8171-1-git-send-email-changbin.du@intel.com
    Signed-off-by: Du, Changbin
    Cc: Jonathan Corbet
    Cc: Josh Triplett
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Tejun Heo
    Cc: Christian Borntraeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Du, Changbin
     
  • Update the return type to use bool instead of int, corresponding to
    cheange (debugobjects: make fixup functions return bool instead of int).

    Signed-off-by: Du, Changbin
    Cc: Jonathan Corbet
    Cc: Josh Triplett
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Tejun Heo
    Cc: Christian Borntraeger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Du, Changbin
     

22 Apr, 2016

2 commits


01 Apr, 2016

18 commits

  • The hotplug notifier rcutorture_cpu_notify() doesn't consider the
    corresponding CPU_XXX_FROZEN transitions. They occur on
    suspend/resume and are usually handled the same way as the
    corresponding non frozen transitions.

    Mask the switch case action argument with '~CPU_TASKS_FROZEN' to map
    CPU_XXX_FROZEN hotplug transitions on corresponding non-frozen
    transitions.

    Cc: Josh Triplett
    Cc: "Paul E. McKenney"
    Signed-off-by: Anna-Maria Gleixner
    Signed-off-by: Paul E. McKenney

    Anna-Maria Gleixner
     
  • The current code initializes the global per-CPU variables
    rcu_torture_count and rcu_torture_batch to zero. However, C does this
    initialization by default, and explicit initialization of per-CPU
    variables now needs a different syntax if "make tags" is to work.
    This commit therefore removes the initialization.

    Reported-by: Peter Zijlstra
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • After finishing its tests rcuperf tries to wake up shutdown_wq even if
    "shutdown" param is set to false, resulting in a wake_up() call on an
    unitialized wait_queue_head_t which leads to "BUG: spinlock bad magic" and
    "BUG: unable to handle kernel NULL pointer dereference".

    Fix by checking "shutdown" param before waking up the queue.

    Signed-off-by: Artem Savkov

    Artem Savkov
     
  • Running rcuperf can result in RCU CPU stall warnings and RT throttling.
    These occur because on of the real-time writer processes does
    ftrace_dump() while still running at real-time priority. This commit
    therefore prevents these problems by setting the writer thread back to
    SCHED_NORMAL (AKA SCHED_OTHER) before doing ftrace_dump().

    In addition, this commit adds a small fixed delay before dumping ftrace
    buffer in order to decrease the probability that this dumping will
    interfere with other writers' grace periods.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Boot-time activity can legitimately grab CPUs for extended time periods,
    so the commit adds a boot parameter to delay the start of the performance
    test until boot has completed. Defaults to 10 seconds.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit enables ftrace in the rcuperf TREE kernel build and adds
    an ftrace_dump() at the end of rcuperf processing. This data will be
    used to measure the actual durations of the expedited grace periods
    without the added delays inherent in the kernel-module measurements.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit forces more deterministic update-side behavior by setting
    rcuperf's rcu_perf_writer() kthreads to real-time priority.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit forces more deterministic behavior by binding rcuperf's
    rcu_perf_reader() and rcu_perf_writer() kthreads to their respective
    CPUs.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit adds a new rcuperf module that carries out simple performance
    tests of RCU grace periods.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit provides rcu_exp_batches_completed() and
    rcu_exp_batches_completed_sched() functions to allow torture-test modules
    to check how many expedited grace period batches have completed.
    These are analogous to the existing rcu_batches_completed(),
    rcu_batches_completed_bh(), and rcu_batches_completed_sched() functions.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Currently, rcu_torture_writer() checks only for rcu_gp_is_expedited()
    when deciding whether or not to do dynamic control of RCU expediting.
    This means that if rcupdate.rcu_normal is specified, rcu_torture_writer()
    will attempt to dynamically control RCU expediting, but will nonetheless
    only test normal RCU grace periods. This commit therefore adds a check
    for !rcu_gp_is_normal(), and prints a message and desists from testing
    dynamic control of RCU expediting when doing so is futile.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • If it is necessary to kick the grace-period kthread, that is a good
    time to dump the trace buffer in order to learn why kicking was needed.
    This commit therefore does the dump.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Currently, we have four versions of rcu_read_lock_sched_held(), depending
    on the combined choices on PREEMPT_COUNT and DEBUG_LOCK_ALLOC. However,
    there is an existing function preemptible() that already distinguishes
    between the PREEMPT_COUNT=y and PREEMPT_COUNT=n cases, and allows these
    four implementations to be consolidated down to two.

    This commit therefore uses preemptible() to achieve this consolidation.

    Note that there could be a small performance regression in the case
    of CONFIG_DEBUG_LOCK_ALLOC=y && PREEMPT_COUNT=n. However, given the
    overhead associated with CONFIG_DEBUG_LOCK_ALLOC=y, this should be
    down in the noise.

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

    Boqun Feng
     
  • Recent kernels can fail to awaken the grace-period kthread for
    quiescent-state forcing. This commit is a crude hack that does
    a wakeup if a scheduling-clock interrupt sees that it has been
    too long since force-quiescent-state (FQS) processing.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Currently, the force-quiescent-state (FQS) code in rcu_gp_kthread() can
    advance the next FQS even if one was not executed last time. This can
    happen due timeout-duration uncertainty. This commit therefore avoids
    advancing the FQS schedule unless an FQS was just executed. In the
    corner case where an FQS was not executed, but is due now, the code does
    a one-jiffy wait.

    This change prepares for kthread kicking.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Recent kernels can fail to awaken the grace-period kthread for
    quiescent-state forcing. This commit is a crude hack that does
    a wakeup any time a stall is detected.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The current expedited grace-period implementation makes subsequent grace
    periods wait on wakeups for the prior grace period. This does not fit
    the dictionary definition of "expedited", so this commit allows these two
    phases to overlap. Doing this requires four waitqueues rather than two
    because tasks can now be waiting on the previous, current, and next grace
    periods. The fourth waitqueue makes the bit masking work out nicely.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit pulls the grace-period-start counter adjustment and tracing
    from synchronize_rcu_expedited() and synchronize_sched_expedited()
    into exp_funnel_lock(), thus eliminating some code duplication.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney