Skip to contentSkip to conversation

rcu: Latch normal synchronize_rcu() path on flood

PATCH New Uladzislau Rezki (Sony) 1 participant 1 message Mar 11

Subsystems (2)
lore
Share & tools
lore

Uladzislau Rezki (Sony)

author maintainer
#0 lore raw

PATCH v3 1/1 rcu: Latch normal synchronize_rcu() path on flood

Currently, rcu_normal_wake_from_gp is only enabled by default on small systems(<= 16 CPUs) or when a user explicitly set it enabled.

Introduce an adaptive latching mechanism:
* Track the number of in-flight synchronize_rcu() requests using a new rcu_sr_normal_count counter;

* If the count reaches/exceeds RCU_SR_NORMAL_LATCH_THR(64), it sets the rcu_sr_normal_latched, reverting new requests onto the scaled wait_rcu_gp() path;

* The latch is cleared only when the pending requests are fully drained(nr == 0);

* Enables rcu_normal_wake_from_gp by default for all systems, relying on this dynamic throttling instead of static CPU limits.

Testing(synthetic flood workload):
* Kernel version: 6.19.0-rc6
* Number of CPUs: 1536
* 60K concurrent synchronize_rcu() calls

Perf(cycles, system-wide):
total cycles: 932020263832 rcu_sr_normal_add_req(): 2650282811 cycles(~0.28%)

Perf report excerpt:
0.01% 0.01% sync_test/... [k] rcu_sr_normal_add_req

Measured overhead of rcu_sr_normal_add_req() remained ~0.28% of total CPU cycles in this synthetic stress test.

---
 .../admin-guide/kernel-parameters.txt         | 10 ++--
 kernel/rcu/tree.c                             | 52 ++++++++++++++-----
 2 files changed, 44 insertions(+), 18 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +5 -5
index cb850e5290c2..d0574a02510d 100644
@@ -5867,13 +5867,13 @@ Kernel parameters
 			use a call_rcu[_hurry]() path. Please note, this is for a
 			normal grace period.
 
-			How to enable it:
+			How to disable it:
 
-			echo 1 > /sys/module/rcutree/parameters/rcu_normal_wake_from_gp
-			or pass a boot parameter "rcutree.rcu_normal_wake_from_gp=1"
+			echo 0 > /sys/module/rcutree/parameters/rcu_normal_wake_from_gp
+			or pass a boot parameter "rcutree.rcu_normal_wake_from_gp=0"
 
-			Default is 1 if num_possible_cpus() <= 16 and it is not explicitly
-			disabled by the boot parameter passing 0.
+			Default is 1 if it is not explicitly disabled by the boot parameter
+			passing 0.
 
 	rcuscale.gp_async= [KNL]
 			Measure performance of asynchronous
kernel/rcu/tree.c +39 -13

104 lines not on this page · raw message

Signature · 1 line
2.47.3