]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rcu/nocb: Extract nocb_bypass_needs_flush() to reduce duplication
authorJoel Fernandes <joelagnelf@nvidia.com>
Sat, 3 Jan 2026 20:54:37 +0000 (15:54 -0500)
committerJoel Fernandes <joelagnelf@nvidia.com>
Mon, 30 Mar 2026 19:48:14 +0000 (15:48 -0400)
commit2243517a5440caa635b945deb7915397ef39b29b
tree62b142b8d2c626017334e6486a7ce100d6ddf408
parent18d01ff3b9812b785673689780bb3868c4c1e2fa
rcu/nocb: Extract nocb_bypass_needs_flush() to reduce duplication

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.

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
kernel/rcu/tree_nocb.h