From 7cc1020efd2c70dcf7fbe18ec7758199a9528f2b Mon Sep 17 00:00:00 2001 From: Yaroslav Furman Date: Sat, 18 Nov 2023 19:29:33 +0100 Subject: [PATCH] rcu: fix a performance regression Commit "rcu: Create RCU-specific workqueues with rescuers" switched RCU to using local workqueses and removed power efficiency flag from them. This caused a performance regression that can be observed in Geekbench 5 after enabling CONFIG_WQ_POWER_EFFICIENT_DEFAULT: score went down from 760/2500 to 620/2300 (single/multi core respectively). Add WQ_POWER_EFFICIENT flag to avoid this regression. --- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 59ce9e2a7..206c1105b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3569,9 +3569,9 @@ void __init rcu_init(void) } /* Create workqueue for expedited GPs and for Tree SRCU. */ - rcu_gp_wq = alloc_workqueue("rcu_gp", WQ_MEM_RECLAIM, 0); + rcu_gp_wq = alloc_workqueue("rcu_gp", WQ_POWER_EFFICIENT | WQ_MEM_RECLAIM, 0); WARN_ON(!rcu_gp_wq); - rcu_par_gp_wq = alloc_workqueue("rcu_par_gp", WQ_MEM_RECLAIM, 0); + rcu_par_gp_wq = alloc_workqueue("rcu_par_gp", WQ_POWER_EFFICIENT | WQ_MEM_RECLAIM, 0); WARN_ON(!rcu_par_gp_wq); srcu_init(); }