@@ -92,12 +92,20 @@ torture_param(bool, gp_cond_exp, false, "Use conditional/async expedited GP wait
92
92
torture_param (bool , gp_cond_full , false, "Use conditional/async full-state GP wait primitives" );
93
93
torture_param (bool , gp_cond_exp_full , false,
94
94
"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)" );
95
99
torture_param (bool , gp_exp , false, "Use expedited GP wait primitives" );
96
100
torture_param (bool , gp_normal , false, "Use normal (non-expedited) GP wait primitives" );
97
101
torture_param (bool , gp_poll , false, "Use polling GP wait primitives" );
98
102
torture_param (bool , gp_poll_exp , false, "Use polling expedited GP wait primitives" );
99
103
torture_param (bool , gp_poll_full , false, "Use polling full-state GP wait primitives" );
100
104
torture_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)" );
101
109
torture_param (bool , gp_sync , false, "Use synchronous GP wait primitives" );
102
110
torture_param (int , irqreader , 1 , "Allow RCU readers from irq handlers" );
103
111
torture_param (int , leakpointer , 0 , "Leak pointer dereferences from readers" );
@@ -1370,6 +1378,7 @@ static void rcu_torture_write_types(void)
1370
1378
pr_alert ("%s: gp_sync without primitives.\n" , __func__ );
1371
1379
}
1372
1380
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 );
1373
1382
}
1374
1383
1375
1384
/*
@@ -1536,31 +1545,35 @@ rcu_torture_writer(void *arg)
1536
1545
case RTWS_COND_GET :
1537
1546
rcu_torture_writer_state = RTWS_COND_GET ;
1538
1547
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 );
1540
1550
rcu_torture_writer_state = RTWS_COND_SYNC ;
1541
1551
cur_ops -> cond_sync (gp_snap );
1542
1552
rcu_torture_pipe_update (old_rp );
1543
1553
break ;
1544
1554
case RTWS_COND_GET_EXP :
1545
1555
rcu_torture_writer_state = RTWS_COND_GET_EXP ;
1546
1556
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 );
1548
1559
rcu_torture_writer_state = RTWS_COND_SYNC_EXP ;
1549
1560
cur_ops -> cond_sync_exp (gp_snap );
1550
1561
rcu_torture_pipe_update (old_rp );
1551
1562
break ;
1552
1563
case RTWS_COND_GET_FULL :
1553
1564
rcu_torture_writer_state = RTWS_COND_GET_FULL ;
1554
1565
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 );
1556
1568
rcu_torture_writer_state = RTWS_COND_SYNC_FULL ;
1557
1569
cur_ops -> cond_sync_full (& gp_snap_full );
1558
1570
rcu_torture_pipe_update (old_rp );
1559
1571
break ;
1560
1572
case RTWS_COND_GET_EXP_FULL :
1561
1573
rcu_torture_writer_state = RTWS_COND_GET_EXP_FULL ;
1562
1574
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 );
1564
1577
rcu_torture_writer_state = RTWS_COND_SYNC_EXP_FULL ;
1565
1578
cur_ops -> cond_sync_exp_full (& gp_snap_full );
1566
1579
rcu_torture_pipe_update (old_rp );
@@ -1580,8 +1593,8 @@ rcu_torture_writer(void *arg)
1580
1593
break ;
1581
1594
}
1582
1595
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 );
1585
1598
}
1586
1599
rcu_torture_pipe_update (old_rp );
1587
1600
break ;
@@ -1601,8 +1614,8 @@ rcu_torture_writer(void *arg)
1601
1614
break ;
1602
1615
}
1603
1616
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 );
1606
1619
}
1607
1620
rcu_torture_pipe_update (old_rp );
1608
1621
break ;
@@ -1611,17 +1624,17 @@ rcu_torture_writer(void *arg)
1611
1624
gp_snap = cur_ops -> start_gp_poll_exp ();
1612
1625
rcu_torture_writer_state = RTWS_POLL_WAIT_EXP ;
1613
1626
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 );
1616
1629
rcu_torture_pipe_update (old_rp );
1617
1630
break ;
1618
1631
case RTWS_POLL_GET_EXP_FULL :
1619
1632
rcu_torture_writer_state = RTWS_POLL_GET_EXP_FULL ;
1620
1633
cur_ops -> start_gp_poll_exp_full (& gp_snap_full );
1621
1634
rcu_torture_writer_state = RTWS_POLL_WAIT_EXP_FULL ;
1622
1635
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 );
1625
1638
rcu_torture_pipe_update (old_rp );
1626
1639
break ;
1627
1640
case RTWS_SYNC :
0 commit comments