lkml.org 
[lkml]   [2021]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH tip/core/rcu 04/17] rcutorture: Require entire stutter period be post-boot
    Date
    From: "Paul E. McKenney" <paulmck@kernel.org>

    Currently, the rcu_torture_writer() function checks that all required
    grace periods elapse during a stutter interval, which is a multi-second
    time period during which the test load is removed. However, this check
    is suppressed during early boot (that is, before init is spawned) in
    order to avoid false positives that otherwise occur due to heavy load
    on the single boot CPU.

    Unfortunately, this approach is insufficient. It is possible that the
    stutter interval might end just as init is spawned, so that early boot
    conditions prevailed during almost the entire stutter interval.

    This commit therefore takes a snapshot of boot-complete state just
    before the stutter interval, thus suppressing the check for failure to
    complete grace periods unless the entire stutter interval took place
    after early boot.

    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
    ---
    kernel/rcu/rcutorture.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
    index 338e118..1930d92 100644
    --- a/kernel/rcu/rcutorture.c
    +++ b/kernel/rcu/rcutorture.c
    @@ -1070,6 +1070,7 @@ rcu_torture_fqs(void *arg)
    static int
    rcu_torture_writer(void *arg)
    {
    + bool boot_ended;
    bool can_expedite = !rcu_gp_is_expedited() && !rcu_gp_is_normal();
    unsigned long cookie;
    int expediting = 0;
    @@ -1239,12 +1240,13 @@ rcu_torture_writer(void *arg)
    !rcu_gp_is_normal();
    }
    rcu_torture_writer_state = RTWS_STUTTER;
    + boot_ended = rcu_inkernel_boot_has_ended();
    stutter_waited = stutter_wait("rcu_torture_writer");
    if (stutter_waited &&
    !READ_ONCE(rcu_fwd_cb_nodelay) &&
    !cur_ops->slow_gps &&
    !torture_must_stop() &&
    - rcu_inkernel_boot_has_ended())
    + boot_ended)
    for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++)
    if (list_empty(&rcu_tortures[i].rtort_free) &&
    rcu_access_pointer(rcu_torture_current) !=
    --
    2.9.5
    \
     
     \ /
      Last update: 2021-01-06 18:19    [W:3.265 / U:0.556 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site