• Paul E. McKenney's avatar
    rcutorture: Handle extended read-side critical sections · 2397d072
    Paul E. McKenney authored
    This commit enables rcutorture to test whether RCU properly aggregates
    different types of read-side critical sections into a larger section
    covering the set.  It does this by extending an initial read-side
    critical section randomly for a random number of extensions.  There is
    a new rcu_torture_ops field ->extendable that specifies what extensions
    are permitted for a given flavor of RCU (for example, SRCU does not
    permit any extensions, while RCU-sched permits all types).  Note that
    if a given operation (for example, local_bh_disable()) extends an RCU
    read-side critical section, then rcutorture feels free to also start
    and end the critical section with that operation's type of disabling.
    
    Disabling operations include local_bh_disable(), local_irq_disable(),
    and preempt_disable().  This commit also adds a new "busted_srcud"
    torture type, which verifies rcutorture's ability to detect extensions
    of RCU read-side critical sections that are not handled.  Gotta test
    the test, after all!
    
    Note that it is not legal to invoke local_bh_disable() with interrupts
    disabled, and this transition is avoided by overriding the random-number
    generator when it wants to call local_bh_disable() while interrupts
    are disabled.  The code instead leaves both interrupts and bh/softirq
    disabled in this case.
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    2397d072
rcutorture.c 59 KB