Re: [PATCH RFC v1 2/4] rcu/nocb: Extract nocb_bypass_needs_flush() to reduce duplication

From: Frederic Weisbecker

Date: Wed Mar 11 2026 - 08:59:11 EST


Le Tue, Feb 24, 2026 at 06:04:33PM -0500, Joel Fernandes a écrit :
> The bypass flush decision logic is duplicated in rcu_nocb_try_bypass()
> and nocb_gp_wait() with similar conditions.
>
> This commit therefore extracts the functionality into a common helper
> function nocb_bypass_needs_flush() improving the code readability.
>
> A flush_faster parameter is added to controlling the flushing thresholds
> and timeouts. This design was in the original commit d1b222c6be1f
> ("rcu/nocb: Add bypass callback queueing") to avoid having the GP
> kthread aggressively flush the bypass queue.
>
> Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>

--
Frederic Weisbecker
SUSE Labs