@@ -92,12 +92,20 @@ torture_param(bool, gp_cond_exp, false, "Use conditional/async expedited GP wait
9292torture_param (bool , gp_cond_full , false, "Use conditional/async full-state GP wait primitives" );
9393torture_param (bool , gp_cond_exp_full , false,
9494 "Use conditional/async full-stateexpedited GP wait primitives" );
95+ torture_param (int , gp_cond_wi , 16 * USEC_PER_SEC / HZ ,
96+ "Wait interval for normal conditional grace periods, us (default 16 jiffies)" );
97+ torture_param (int , gp_cond_wi_exp , 128 ,
98+ "Wait interval for expedited conditional grace periods, us (default 128 us)" );
9599torture_param (bool , gp_exp , false, "Use expedited GP wait primitives" );
96100torture_param (bool , gp_normal , false, "Use normal (non-expedited) GP wait primitives" );
97101torture_param (bool , gp_poll , false, "Use polling GP wait primitives" );
98102torture_param (bool , gp_poll_exp , false, "Use polling expedited GP wait primitives" );
99103torture_param (bool , gp_poll_full , false, "Use polling full-state GP wait primitives" );
100104torture_param (bool , gp_poll_exp_full , false, "Use polling full-state expedited GP wait primitives" );
105+ torture_param (int , gp_poll_wi , 16 * USEC_PER_SEC / HZ ,
106+ "Wait interval for normal polled grace periods, us (default 16 jiffies)" );
107+ torture_param (int , gp_poll_wi_exp , 128 ,
108+ "Wait interval for expedited polled grace periods, us (default 128 us)" );
101109torture_param (bool , gp_sync , false, "Use synchronous GP wait primitives" );
102110torture_param (int , irqreader , 1 , "Allow RCU readers from irq handlers" );
103111torture_param (int , leakpointer , 0 , "Leak pointer dereferences from readers" );
@@ -1370,6 +1378,7 @@ static void rcu_torture_write_types(void)
13701378 pr_alert ("%s: gp_sync without primitives.\n" , __func__ );
13711379 }
13721380 pr_alert ("%s: Testing %d update types.\n" , __func__ , nsynctypes );
1381+ pr_info ("%s: gp_cond_wi %d gp_cond_wi_exp %d gp_poll_wi %d gp_poll_wi_exp %d\n" , __func__ , gp_cond_wi , gp_cond_wi_exp , gp_poll_wi , gp_poll_wi_exp );
13731382}
13741383
13751384/*
@@ -1536,31 +1545,35 @@ rcu_torture_writer(void *arg)
15361545 case RTWS_COND_GET :
15371546 rcu_torture_writer_state = RTWS_COND_GET ;
15381547 gp_snap = cur_ops -> get_gp_state ();
1539- torture_hrtimeout_jiffies (torture_random (& rand ) % 16 , & rand );
1548+ torture_hrtimeout_us (torture_random (& rand ) % gp_cond_wi ,
1549+ 1000 , & rand );
15401550 rcu_torture_writer_state = RTWS_COND_SYNC ;
15411551 cur_ops -> cond_sync (gp_snap );
15421552 rcu_torture_pipe_update (old_rp );
15431553 break ;
15441554 case RTWS_COND_GET_EXP :
15451555 rcu_torture_writer_state = RTWS_COND_GET_EXP ;
15461556 gp_snap = cur_ops -> get_gp_state_exp ();
1547- torture_hrtimeout_jiffies (torture_random (& rand ) % 16 , & rand );
1557+ torture_hrtimeout_us (torture_random (& rand ) % gp_cond_wi_exp ,
1558+ 1000 , & rand );
15481559 rcu_torture_writer_state = RTWS_COND_SYNC_EXP ;
15491560 cur_ops -> cond_sync_exp (gp_snap );
15501561 rcu_torture_pipe_update (old_rp );
15511562 break ;
15521563 case RTWS_COND_GET_FULL :
15531564 rcu_torture_writer_state = RTWS_COND_GET_FULL ;
15541565 cur_ops -> get_gp_state_full (& gp_snap_full );
1555- torture_hrtimeout_jiffies (torture_random (& rand ) % 16 , & rand );
1566+ torture_hrtimeout_us (torture_random (& rand ) % gp_cond_wi ,
1567+ 1000 , & rand );
15561568 rcu_torture_writer_state = RTWS_COND_SYNC_FULL ;
15571569 cur_ops -> cond_sync_full (& gp_snap_full );
15581570 rcu_torture_pipe_update (old_rp );
15591571 break ;
15601572 case RTWS_COND_GET_EXP_FULL :
15611573 rcu_torture_writer_state = RTWS_COND_GET_EXP_FULL ;
15621574 cur_ops -> get_gp_state_full (& gp_snap_full );
1563- torture_hrtimeout_jiffies (torture_random (& rand ) % 16 , & rand );
1575+ torture_hrtimeout_us (torture_random (& rand ) % gp_cond_wi_exp ,
1576+ 1000 , & rand );
15641577 rcu_torture_writer_state = RTWS_COND_SYNC_EXP_FULL ;
15651578 cur_ops -> cond_sync_exp_full (& gp_snap_full );
15661579 rcu_torture_pipe_update (old_rp );
@@ -1580,8 +1593,8 @@ rcu_torture_writer(void *arg)
15801593 break ;
15811594 }
15821595 WARN_ON_ONCE (ulo_size > 0 && i >= ulo_size );
1583- torture_hrtimeout_us (torture_random (& rand ) % 128 , 1000 ,
1584- & rand );
1596+ torture_hrtimeout_us (torture_random (& rand ) % gp_poll_wi ,
1597+ 1000 , & rand );
15851598 }
15861599 rcu_torture_pipe_update (old_rp );
15871600 break ;
@@ -1601,8 +1614,8 @@ rcu_torture_writer(void *arg)
16011614 break ;
16021615 }
16031616 WARN_ON_ONCE (rgo_size > 0 && i >= rgo_size );
1604- torture_hrtimeout_us (torture_random (& rand ) % 128 , 1000 ,
1605- & rand );
1617+ torture_hrtimeout_us (torture_random (& rand ) % gp_poll_wi ,
1618+ 1000 , & rand );
16061619 }
16071620 rcu_torture_pipe_update (old_rp );
16081621 break ;
@@ -1611,17 +1624,17 @@ rcu_torture_writer(void *arg)
16111624 gp_snap = cur_ops -> start_gp_poll_exp ();
16121625 rcu_torture_writer_state = RTWS_POLL_WAIT_EXP ;
16131626 while (!cur_ops -> poll_gp_state_exp (gp_snap ))
1614- torture_hrtimeout_us (torture_random (& rand ) % 128 , 1000 ,
1615- & rand );
1627+ torture_hrtimeout_us (torture_random (& rand ) % gp_poll_wi_exp ,
1628+ 1000 , & rand );
16161629 rcu_torture_pipe_update (old_rp );
16171630 break ;
16181631 case RTWS_POLL_GET_EXP_FULL :
16191632 rcu_torture_writer_state = RTWS_POLL_GET_EXP_FULL ;
16201633 cur_ops -> start_gp_poll_exp_full (& gp_snap_full );
16211634 rcu_torture_writer_state = RTWS_POLL_WAIT_EXP_FULL ;
16221635 while (!cur_ops -> poll_gp_state_full (& gp_snap_full ))
1623- torture_hrtimeout_us (torture_random (& rand ) % 128 , 1000 ,
1624- & rand );
1636+ torture_hrtimeout_us (torture_random (& rand ) % gp_poll_wi_exp ,
1637+ 1000 , & rand );
16251638 rcu_torture_pipe_update (old_rp );
16261639 break ;
16271640 case RTWS_SYNC :
0 commit comments