• Frederic Weisbecker's avatar
    rcu/nocb: Provide basic callback offloading state machine bits · 8d346d43
    Frederic Weisbecker authored
    Offloading and de-offloading RCU callback processes must be done
    carefully.  There must never be a time at which callback processing is
    disabled because the task driving the offloading or de-offloading might be
    preempted or otherwise stalled at that point in time, which would result
    in OOM due to calbacks piling up indefinitely.  This implies that there
    will be times during which a given CPU's callbacks might be concurrently
    invoked by both that CPU's RCU_SOFTIRQ handler (or, equivalently, that
    CPU's rcuc kthread) and by that CPU's rcuo kthread.
    
    This situation could fatally confuse both rcu_barrier() and the
    CPU-hotplug offlining process, so these must be excluded during any
    concurrent-callback-invocation period.  In addition, during times of
    concurrent callback invocation, changes to ->cblist must be protected
    both as needed for RCU_SOFTIRQ and as needed for the rcuo kthread.
    
    This commit therefore defines and documents the states for a state
    machine that coordinates offloading and deoffloading.
    
    Cc: Josh Triplett <josh@joshtriplett.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Lai Jiangshan <jiangshanlai@gmail.com>
    Cc: Joel Fernandes <joel@joelfernandes.org>
    Cc: Neeraj Upadhyay <neeraju@codeaurora.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Inspired-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    Tested-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    8d346d43
rcu_segcblist.h 4.43 KB