From: Michal Schmidt Date: Mon, 7 Oct 2024 10:14:15 +0000 (+0200) Subject: rcu/srcutiny: don't return before reenabling preemption X-Git-Tag: v6.13-rc1~190^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ea3acbc804c2d5a165442cdf9c0526f4d324888;p=thirdparty%2Fkernel%2Flinux.git rcu/srcutiny: don't return before reenabling preemption Code after the return statement is dead. Enable preemption before returning from srcu_drive_gp(). This will be important when/if PREEMPT_AUTO (lazy resched) gets merged. Fixes: 65b4a59557f6 ("srcu: Make Tiny SRCU explicitly disable preemption") Reviewed-by: Paul E. McKenney Signed-off-by: Michal Schmidt Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker --- diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c index 549c03336ee97..4dcbf8aa80ff7 100644 --- a/kernel/rcu/srcutiny.c +++ b/kernel/rcu/srcutiny.c @@ -122,8 +122,8 @@ void srcu_drive_gp(struct work_struct *wp) ssp = container_of(wp, struct srcu_struct, srcu_work); preempt_disable(); // Needed for PREEMPT_AUTO if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) { - return; /* Already running or nothing to do. */ preempt_enable(); + return; /* Already running or nothing to do. */ } /* Remove recently arrived callbacks and wait for readers. */