Skip to content

Commit de2ad0e

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
rcutorture: Test start-poll primitives with interrupts disabled
This commit tests the ->start_poll() and ->start_poll_full() functions with interrupts disabled, but only for RCU variants setting the ->start_poll_irqsoff flag. Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Neeraj Upadhyay <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent a307638 commit de2ad0e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/rcu/rcutorture.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ struct rcu_torture_ops {
393393
int slow_gps;
394394
int no_pi_lock;
395395
int debug_objects;
396+
int start_poll_irqsoff;
396397
const char *name;
397398
};
398399

@@ -581,6 +582,7 @@ static struct rcu_torture_ops rcu_ops = {
581582
.can_boost = IS_ENABLED(CONFIG_RCU_BOOST),
582583
.extendables = RCUTORTURE_MAX_EXTEND,
583584
.debug_objects = 1,
585+
.start_poll_irqsoff = 1,
584586
.name = "rcu"
585587
};
586588

@@ -1695,14 +1697,22 @@ rcu_torture_fakewriter(void *arg)
16951697
cur_ops->cond_sync_exp_full(&gp_snap_full);
16961698
break;
16971699
case RTWS_POLL_GET:
1700+
if (cur_ops->start_poll_irqsoff)
1701+
local_irq_disable();
16981702
gp_snap = cur_ops->start_gp_poll();
1703+
if (cur_ops->start_poll_irqsoff)
1704+
local_irq_enable();
16991705
while (!cur_ops->poll_gp_state(gp_snap)) {
17001706
torture_hrtimeout_jiffies(torture_random(&rand) % 16,
17011707
&rand);
17021708
}
17031709
break;
17041710
case RTWS_POLL_GET_FULL:
1711+
if (cur_ops->start_poll_irqsoff)
1712+
local_irq_disable();
17051713
cur_ops->start_gp_poll_full(&gp_snap_full);
1714+
if (cur_ops->start_poll_irqsoff)
1715+
local_irq_enable();
17061716
while (!cur_ops->poll_gp_state_full(&gp_snap_full)) {
17071717
torture_hrtimeout_jiffies(torture_random(&rand) % 16,
17081718
&rand);

0 commit comments

Comments
 (0)