• Paul E. McKenney's avatar
    rcu-tasks: Permit use of debug-objects with RCU Tasks flavors · cb88f7f5
    Paul E. McKenney authored
    
    
    Currently, cblist_init_generic() holds a raw spinlock when invoking
    INIT_WORK().  This fails in kernels built with CONFIG_DEBUG_OBJECTS=y
    due to memory allocation being forbidden while holding a raw spinlock.
    But the only reason for holding the raw spinlock is to synchronize
    with early boot calls to call_rcu_tasks(), call_rcu_tasks_rude, and,
    last but not least, call_rcu_tasks_trace().  These calls also invoke
    cblist_init_generic() in order to support early boot queueing of
    callbacks.
    
    Except that there are no early boot calls to either of these three
    functions, and the BPF guys confirm that they have no plans to add any
    such calls.
    
    This commit therefore removes the synchronization and adds a
    WARN_ON_ONCE() to catch the case of now-prohibited early boot RCU Tasks
    callback queueing.
    
    If early boot queueing is needed, an "initialized" flag may be added to
    the rcu_tasks structure.  Then queueing a callback before this flag is set
    would initialize the callback list (if needed) and queue the callback.
    The decision as to where to queue the callback given the possibility of
    non-zero boot CPUs is left as an exercise for the reader.
    Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    cb88f7f5
tasks.h 69.1 KB