• Paul E. McKenney's avatar
    rcu: Correctly handle non-empty Tiny RCU callback list with none ready · adb2a13e
    Paul E. McKenney authored
    [ Upstream commit 6e91f8cb ]
    
    If, at the time __rcu_process_callbacks() is invoked,  there are callbacks
    in Tiny RCU's callback list, but none of them are ready to be invoked,
    the current list-management code will knit the non-ready callbacks out
    of the list.  This can result in hangs and possibly worse.  This commit
    therefore inserts a check for there being no callbacks that can be
    invoked immediately.
    
    This bug is unlikely to occur -- you have to get a new callback between
    the time rcu_sched_qs() or rcu_bh_qs() was called, but before we get to
    __rcu_process_callbacks().  It was detected by the addition of RCU-bh
    testing to rcutorture, which in turn was instigated by Iftekhar Ahmed's
    mutation testing.  Although this bug was made much more likely by
    915e8a4f (rcu: Remove fastpath from __rcu_process_callbacks()), this
    did not cause the bug, but rather made it much more probable.   That
    said, it takes ...
    adb2a13e
tiny.c 10.6 KB