Skip to content

Commit a636c5e

Browse files
Frederic Weisbeckerfbq
authored andcommitted
rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery
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: 9621fbe ("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>
1 parent a7e4074 commit a636c5e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/rcu/tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4749,6 +4749,7 @@ static void __init rcu_start_exp_gp_kworkers(void)
47494749
rcu_exp_par_gp_kworker = kthread_create_worker(0, par_gp_kworker_name);
47504750
if (IS_ERR_OR_NULL(rcu_exp_par_gp_kworker)) {
47514751
pr_err("Failed to create %s!\n", par_gp_kworker_name);
4752+
rcu_exp_par_gp_kworker = NULL;
47524753
kthread_destroy_worker(rcu_exp_gp_kworker);
47534754
return;
47544755
}

0 commit comments

Comments
 (0)