]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery
authorFrederic Weisbecker <frederic@kernel.org>
Fri, 12 Jan 2024 15:46:15 +0000 (16:46 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:17 +0000 (18:19 -0400)
commit6047cdf6fcce29c21c4c6524ebafbee65c7ed27c
tree04db123646861fc5521cbb4617eead0650e7772b
parentec09bcab32fc4765e0cc97e1b72cdd067135f37e
rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery

[ Upstream commit a636c5e6f8fc34be520277e69c7c6ee1d4fc1d17 ]

Under CONFIG_RCU_EXP_KTHREAD=y, the nodes initialization for expedited
grace periods is queued to a kworker. However if the allocation of that
kworker failed, the nodes initialization is performed synchronously by
the caller instead.

Now the check for kworker initialization failure relies on the kworker
pointer to be NULL while its value might actually encapsulate an
allocation failure error.

Make sure to handle this case.

Reviewed-by: Kalesh Singh <kaleshsingh@google.com>
Fixes: 9621fbee44df ("rcu: Move expedited grace period (GP) work to RT kthread_worker")
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/tree.c