rcu: Make call_rcu_tasks() tolerate first call with irqs disabled
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 2 May 2016 18:58:56 +0000 (11:58 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 15 Jun 2016 22:45:00 +0000 (15:45 -0700)
commit4929c913bda505dbe44bb42c00da06011fee6c9d
treeaa11d64d780bba090f5e964308ab88c397340754
parent570dd3c7424179b831decb655ea9dd1ecea38adc
rcu: Make call_rcu_tasks() tolerate first call with irqs disabled

Currently, if the very first call to call_rcu_tasks() has irqs disabled,
it will create the rcu_tasks_kthread with irqs disabled, which will
result in a splat in the memory allocator, which kthread_run() invokes
with the expectation that irqs are enabled.

This commit fixes this problem by deferring kthread creation if called
with irqs disabled.  The first call to call_rcu_tasks() that has irqs
enabled will create the kthread.

This bug was detected by rcutorture changes that were motivated by
Iftekhar Ahmed's mutation-testing efforts.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rcupdate.h
kernel/rcu/update.c