04 Sep, 2020

1 commit


25 Aug, 2020

2 commits

  • People running automated tests have asked for a way to make RCU minimize
    grace-period duration in order to increase the probability of KASAN
    detecting a pointer being improperly leaked from an RCU read-side critical
    section, for example, like this:

    rcu_read_lock();
    p = rcu_dereference(gp);
    do_something_with(p); // OK
    rcu_read_unlock();
    do_something_else_with(p); // BUG!!!

    The rcupdate.rcu_expedited boot parameter is a start in this direction,
    given that it makes calls to synchronize_rcu() instead invoke the faster
    (and more wasteful) synchronize_rcu_expedited(). However, this does
    nothing to shorten RCU grace periods that are instead initiated by
    call_rcu(), and RCU pointer-leak bugs can involve call_rcu() just as
    surely as they can synchronize_rcu().

    This commit therefore adds a RCU_STRICT_GRACE_PERIOD Kconfig option
    that will be used to shorten normal (non-expedited) RCU grace periods.
    This commit also dumps out a message when this option is in effect.
    Later commits will actually shorten grace periods.

    Reported-by Jann Horn
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     
  • This commit further avoids conflation of rcuperf with the kernel's perf
    feature by renaming kernel/rcu/rcuperf.c to kernel/rcu/rcuscale.c, and
    also by similarly renaming the functions and variables inside this file.
    This has the side effect of changing the names of the kernel boot
    parameters, so kernel-parameters.txt and ver_functions.sh are also
    updated. The rcutorture --torture type was also updated from rcuperf
    to rcuscale.

    [ paulmck: Fix bugs located by Stephen Rothwell. ]
    Reported-by: Ingo Molnar
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

30 Jun, 2020

2 commits

  • The old Kconfig option name is all too easy to conflate with the
    unrelated "perf" feature, so this commit renames RCU_REF_PERF_TEST to
    RCU_REF_SCALE_TEST.

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

    Paul E. McKenney
     
  • Add a test for comparing the performance of RCU with various read-side
    synchronization mechanisms. The test has proved useful for collecting
    data and performing these comparisons.

    Currently RCU, SRCU, reader-writer lock, reader-writer semaphore and
    reference counting can be measured using refperf.perf_type parameter.
    Each invocation of the test runs measures performance of a specific
    mechanism.

    The maximum number of CPUs to concurrently run readers on is chosen by
    the test itself and is 75% of the total number of CPUs. So if you had 24
    CPUs, the test runs with a maximum of 18 parallel readers.

    A number of experiments are conducted, and in each experiment, the
    number of readers is increased by 1, upto the 75% of CPUs mark. During
    each experiment, all readers execute an empty loop with refperf.loops
    iterations and time the total loop duration. This is then averaged.

    Example output:
    Parameters "refperf.perf_type=srcu refperf.loops=2000000" looks like:

    [ 3.347133] srcu-ref-perf:
    [ 3.347133] Threads Time(ns)
    [ 3.347133] 1 36
    [ 3.347133] 2 34
    [ 3.347133] 3 34
    [ 3.347133] 4 34
    [ 3.347133] 5 33
    [ 3.347133] 6 33
    [ 3.347133] 7 33
    [ 3.347133] 8 33
    [ 3.347133] 9 33
    [ 3.347133] 10 33
    [ 3.347133] 11 33
    [ 3.347133] 12 33
    [ 3.347133] 13 33
    [ 3.347133] 14 33
    [ 3.347133] 15 32
    [ 3.347133] 16 33
    [ 3.347133] 17 33
    [ 3.347133] 18 34

    Signed-off-by: Joel Fernandes (Google)
    Signed-off-by: Paul E. McKenney

    Joel Fernandes (Google)
     

28 Apr, 2020

2 commits


10 Aug, 2019

1 commit

  • This commit adds RCU-reader checks to list_for_each_entry_rcu() and
    hlist_for_each_entry_rcu(). These checks are optional, and are indicated
    by a lockdep expression passed to a new optional argument to these two
    macros. If this optional lockdep expression is omitted, these two macros
    act as before, checking for an RCU read-side critical section.

    Signed-off-by: Joel Fernandes (Google)
    [ paulmck: Update to eliminate return within macro and update comment. ]
    Signed-off-by: Paul E. McKenney

    Joel Fernandes (Google)
     

21 May, 2019

1 commit


09 Jun, 2017

1 commit

  • 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