@@ -1632,8 +1632,10 @@ static void rcu_sr_put_wait_head(struct llist_node *node)
1632
1632
atomic_set_release (& sr_wn -> inuse , 0 );
1633
1633
}
1634
1634
1635
- /* Disabled by default. */
1636
- static int rcu_normal_wake_from_gp ;
1635
+ /* Enable rcu_normal_wake_from_gp automatically on small systems. */
1636
+ #define WAKE_FROM_GP_CPU_THRESHOLD 16
1637
+
1638
+ static int rcu_normal_wake_from_gp = -1 ;
1637
1639
module_param (rcu_normal_wake_from_gp , int , 0644 );
1638
1640
static struct workqueue_struct * sync_wq ;
1639
1641
@@ -3250,7 +3252,7 @@ static void synchronize_rcu_normal(void)
3250
3252
3251
3253
trace_rcu_sr_normal (rcu_state .name , & rs .head , TPS ("request" ));
3252
3254
3253
- if (! READ_ONCE (rcu_normal_wake_from_gp )) {
3255
+ if (READ_ONCE (rcu_normal_wake_from_gp ) < 1 ) {
3254
3256
wait_rcu_gp (call_rcu_hurry );
3255
3257
goto trace_complete_out ;
3256
3258
}
@@ -4854,6 +4856,12 @@ void __init rcu_init(void)
4854
4856
sync_wq = alloc_workqueue ("sync_wq" , WQ_MEM_RECLAIM , 0 );
4855
4857
WARN_ON (!sync_wq );
4856
4858
4859
+ /* Respect if explicitly disabled via a boot parameter. */
4860
+ if (rcu_normal_wake_from_gp < 0 ) {
4861
+ if (num_possible_cpus () <= WAKE_FROM_GP_CPU_THRESHOLD )
4862
+ rcu_normal_wake_from_gp = 1 ;
4863
+ }
4864
+
4857
4865
/* Fill in default value for rcutree.qovld boot parameter. */
4858
4866
/* -After- the rcu_node ->lock fields are initialized! */
4859
4867
if (qovld < 0 )
0 commit comments