09 Jun, 2017

31 commits

  • Tiny RCU's job is to be tiny, so this commit removes its RCU CPU
    stall warning code. After this, there is no longer any need for
    rcu_sched_ctrlblk and rcu_bh_ctrlblk to be in tiny_plugin.h, so this
    commit also moves them to tiny.c.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit saves a few lines by getting rid of Tiny RCU's event tracing.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • RCU's debugging Kconfig options are in the unintuitive location
    lib/Kconfig.debug, and there are enough of them that it would be good for
    them to be more centralized. This commit therefore extracts RCU's Kconfig
    options from init/Kconfig into a new kernel/rcu/Kconfig.debug file.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • RCU's Kconfig options are scattered, and there are enough of them
    that it would be good for them to be more centralized. This commit
    therefore extracts RCU's Kconfig options from init/Kconfig into a new
    kernel/rcu/Kconfig file.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The CONFIG_RCU_NOCB_CPU_ALL, CONFIG_RCU_NOCB_CPU_NONE, and
    CONFIG_RCU_NOCB_CPU_ZERO Kconfig options are used only in testing and
    are redundant with the rcu_nocbs= boot parameter. This commit therefore
    removes these three Kconfig options and adjusts the rcutorture scripts
    to use the boot parameter instead.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • RCU's debugfs tracing used to be the only reasonable low-level debug
    information available, but ftrace and event tracing has since surpassed
    the RCU debugfs level of usefulness. This commit therefore removes
    RCU's debugfs tracing.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Classic SRCU was only ever intended to be a fallback in case of issues
    with Tree/Tiny SRCU, and the latter two are doing quite well in testing.
    This commit therefore removes Classic SRCU.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The function srcutorture_get_gp_data() duplicated the check for
    sp->batch_check0.head instead of also checking sp->batch_check1.head.
    The only effect of this typo would be for rcutorture statistics to
    understate the fraction of time that an SRCU grace period was in flight,
    and only for Classic SRCU. This commit fixes this typo.

    Reported-by: David Binderman
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The PROVE_RCU_REPEATEDLY Kconfig option was initially added due to
    the volume of messages from PROVE_RCU: Doing just one per boot would
    have required excessive numbers of boots to locate them all. However,
    PROVE_RCU messages are now relatively rare, so there is no longer any
    reason to need more than one such message per boot. This commit therefore
    removes the PROVE_RCU_REPEATEDLY Kconfig option.

    Signed-off-by: Paul E. McKenney
    Cc: Ingo Molnar

    Paul E. McKenney
     
  • Because raw_spin_lock_irqsave() and raw_spin_unlock_irqrestore()
    both do typecheck() on their flags argument, there is no point in
    duplicating this check in raw_spin_lock_irqsave_rcu_node() and
    raw_spin_unlock_irqrestore_rcu_node(). This commit therefore saves
    a few lines by removing this duplicated check.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The NO_HZ_FULL_SYSIDLE full-system-idle capability was added in 2013
    by commit 0edd1b1784cb ("nohz_full: Add full-system-idle state machine"),
    but has not been used. This commit therefore removes it.

    If it turns out to be needed later, this commit can always be reverted.

    Signed-off-by: Paul E. McKenney
    Cc: Frederic Weisbecker
    Cc: Rik van Riel
    Cc: Ingo Molnar
    Acked-by: Linus Torvalds

    Paul E. McKenney
     
  • Anything that can be done with the RCU_KTHREAD_PRIO Kconfig option can
    also be done with the rcutree.kthread_prio kernel boot parameter.
    This commit therefore removes this Kconfig option.

    Reported-by: Linus Torvalds
    Signed-off-by: Paul E. McKenney
    Cc: Frederic Weisbecker
    Cc: Rik van Riel

    Paul E. McKenney
     
  • The RCU_TORTURE_TEST_SLOW_PREINIT, RCU_TORTURE_TEST_SLOW_PREINIT_DELAY,
    RCU_TORTURE_TEST_SLOW_PREINIT_DELAY, RCU_TORTURE_TEST_SLOW_INIT,
    RCU_TORTURE_TEST_SLOW_INIT_DELAY, RCU_TORTURE_TEST_SLOW_CLEANUP,
    and RCU_TORTURE_TEST_SLOW_CLEANUP_DELAY Kconfig options are only
    useful for torture testing, and there are the rcutree.gp_cleanup_delay,
    rcutree.gp_init_delay, and rcutree.gp_preinit_delay kernel boot parameters
    that rcutorture can use instead. The effect of these parameters is to
    artificially slow down grace period initialization and cleanup in order
    to make some types of race conditions happen more often.

    This commit therefore simplifies Tree RCU a bit by removing the Kconfig
    options and adding the corresponding kernel parameters to rcutorture's
    .boot files instead. However, this commit also leaves out the kernel
    parameters for TREE02, TREE04, and TREE07 in order to have about the
    same number of tests slowed as not slowed. TREE01, TREE03, TREE05,
    and TREE06 are slowed, and the rest are not slowed.

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

    Paul E. McKenney
     
  • This commit uses TREE RCU's rnp->lock wrappers to replace a few explicit
    memory barriers. This change also has the advantage of making SRCU's
    memory-ordering properties be implemented in roughly the same way as they
    are in Tree RCU.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit moves the now-generic rnp->lock wrapper macros from
    kernel/rcu/tree.h to kernel/rcu/rcu.h, thus allowing SRCU to use them.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Use of smp_mb__after_unlock_lock() would allow SRCU to omit a full
    memory barrier during callback execution, so this commit converts
    raw_spin_lock_rcu_node() from inline functions to type-generic macros
    to allow them to handle locks in srcu_node structures as well as
    rcu_node structures.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_segcblist structure provides quite a bit of functionality, and
    Tiny SRCU needs almost none of it. So this commit replaces Tiny SRCU's
    uses of rcu_segcblist with a simple singly linked list with tail pointer.
    This change significantly reduces Tiny SRCU's memory footprint, more
    than making up for the growth caused by the creation of rcu_segcblist.c

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The call_srcu() docbook entry is currently in include/linux/srcu.h,
    which causes needless processing for each include point. This commit
    therefore moves this entry to kernel/rcu/srcutree.c, which the compiler
    reads only once. In addition, the srcu_batches_completed() function is
    used only within RCU and its torture-test suites. This commit therefore
    also moves this function's declaration from include/linux/srcutiny.h,
    include/linux/srcutree.h, and include/linux/srcuclassic.h to
    kernel/rcu/rcu.h.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • If a given CPU never happens to ever start an SRCU grace period, the
    grace-period sequence counter might wrap. If this CPU were to decide to
    finally start a grace period, the state of its sdp->srcu_gp_seq_needed
    might make it appear that it has already requested this grace period,
    which would prevent starting the grace period. If no other CPU ever started
    a grace period again, this would look like a grace-period hang. Even
    if some other CPU took pity and started the needed grace period, the
    leaf rcu_node structure's ->srcu_data_have_cbs field won't have record
    of the fact that this CPU has a callback pending, which would look like
    a very localized grace-period hang.

    This might seem very unlikely, but SRCU grace periods can take less than
    a microsecond on small systems, which means that overflow can happen
    in much less than an hour on a 32-bit embedded system. And embedded
    systems are especially likely to have long-term idle CPUs. Therefore,
    it makes sense to prevent this scenario from happening.

    This commit therefore scans each srcu_data structure occasionally,
    with frequency controlled by the srcutree.counter_wrap_check kernel
    boot parameter. This parameter can be set to something like 255
    in order to exercise the counter-wrap-prevention code.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_request_urgent_qs_task() function is used only within RCU,
    so there is no point in exporting it to the rest of the kernel from
    nclude/linux/rcutiny.h and include/linux/rcutree.h. This commit therefore
    moves this function to kernel/rcu/rcu.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The various functions similar to rcu_batches_started(), the
    function show_rcu_gp_kthreads(), the various functions similar to
    rcu_force_quiescent_state(), and the variables rcutorture_testseq and
    rcutorture_vernum are used only within RCU. There is therefore no point
    in exporting them to the kernel at large from include/linux/rcutiny.h
    and include/linux/rcutree.h. This commit therefore moves all of these
    to kernel/rcu/rcu.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_ftrace_dump() function is used only internally to RCU. This
    commit therefore moves its declaration from include/linux/rcupdate.h
    to kernel/rcu/rcu.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_is_nocb_cpu() function is used only internally to RCU. This
    commit therefore moves its declaration from include/linux/rcupdate.h
    to kernel/rcu/rcu.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The "__call_rcu(): Leaked duplicate callback" error message from
    __call_rcu() has proven to be unhelpful. This commit therefore changes
    it to "__call_rcu(): Double-freed CB" and adds the value of the pointer
    passed in. The value of the pointer improves debuggability by allowing
    correlation with tracing output, for example, the rcu:rcu_callback trace
    event.

    Reported-by: Vegard Nossum
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The RCU_SCHEDULER_INACTIVE, RCU_SCHEDULER_INIT, and RCU_SCHEDULER_RUNNING
    definitions are used only within RCU, so this commit moves them from
    include/linux/rcupdate.h to kernel/rcu/rcu.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The __rcu_is_watching() function is currently not used, aside from
    to implement the rcu_is_watching() function. This commit therefore
    eliminates __rcu_is_watching(), which has the beneficial side-effect
    of shrinking include/linux/rcupdate.h a bit.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The include/linux/rcupdate.h file contains a number of definitions that
    are used only to communicate between rcutorture, rcuperf, and the RCU code
    itself. There is no point in having these definitions exposed globally
    throughout the kernel, so this commit moves them to kernel/rcu/rcu.h.
    This change has the added benefit of shrinking rcupdate.h.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_gp_is_normal(), rcu_gp_is_expedited(), rcu_expedite_gp(), and
    rcu_unexpedite_gp() functions are intended only for use within the
    RCU implementation itself -- the sysfs access is what should be used
    outside of RCU. This commit therefore moves the declarations for
    these functions to kernel/rcu/rcu.h, and also includes this file into
    kernel/rcu/rcutorture.c and kernel/rcu/rcuperf.c. This also has the
    beneficial effect of shrinking rcupdate.c a bit.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The rcu_expedited and rcu_normal variables are used only by sysctl
    and kernel/rcu/update.c, so it does not make sense to their extern
    declarations in rcupdate.h. This commit therefore moves these
    extern declarations to update.c.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • The include/linux/rcupdate.h file is included by more than 200
    files, so shrinking it should provide some build-time benefits.
    This commit therefore moves several docbook comments from rcupdate.h to
    kernel/rcu/update.c, kernel/rcu/tree.c, and kernel/rcu/tree_plugin.h, thus
    reducing the number of times that the compiler has to scan these comments.
    This likely provides only a small benefit, but every little bit helps.

    This commit also fixes a malformed bulleted list noted by the 0day
    Test Robot.

    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • Wait/wakeup operations do not guarantee ordering on their own. Instead,
    either locking or memory barriers are required. This commit therefore
    adds memory barriers to wake_nocb_leader() and nocb_leader_wait().

    Signed-off-by: Paul E. McKenney
    Tested-by: Krister Johansen
    Cc: # 4.6.x

    Paul E. McKenney
     

08 Jun, 2017

9 commits