@@ -47,8 +47,8 @@ torture_param(int, shuffle_interval, 3, "Number of jiffies between shuffles, 0=d
47
47
torture_param (int , shutdown_secs , 0 , "Shutdown time (j), <= zero to disable." );
48
48
torture_param (int , stat_interval , 60 , "Number of seconds between stats printk()s" );
49
49
torture_param (int , stutter , 5 , "Number of jiffies to run/halt test, 0=disable" );
50
- torture_param (int , writer_fifo , 0 , "Run writers at sched_set_fifo() priority" );
51
50
torture_param (int , verbose , 1 , "Enable verbose debugging printk()s" );
51
+ torture_param (int , writer_fifo , 0 , "Run writers at sched_set_fifo() priority" );
52
52
/* Going much higher trips "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low!" errors */
53
53
#define MAX_NESTED_LOCKS 8
54
54
@@ -166,12 +166,9 @@ static int torture_lock_busted_write_lock(int tid __maybe_unused)
166
166
167
167
static void torture_lock_busted_write_delay (struct torture_random_state * trsp )
168
168
{
169
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
170
-
171
169
/* We want a long delay occasionally to force massive contention. */
172
- if (!(torture_random (trsp ) %
173
- (cxt .nrealwriters_stress * 2000 * longdelay_ms )))
174
- mdelay (longdelay_ms );
170
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold )))
171
+ mdelay (long_hold );
175
172
if (!(torture_random (trsp ) % (cxt .nrealwriters_stress * 20000 )))
176
173
torture_preempt_schedule (); /* Allow test to be preempted. */
177
174
}
@@ -244,15 +241,14 @@ __acquires(torture_spinlock)
244
241
static void torture_spin_lock_write_delay (struct torture_random_state * trsp )
245
242
{
246
243
const unsigned long shortdelay_us = 2 ;
247
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
248
244
unsigned long j ;
249
245
250
246
/* We want a short delay mostly to emulate likely code, and
251
247
* we want a long delay occasionally to force massive contention.
252
248
*/
253
- if (!(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * longdelay_ms ))) {
249
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold ))) {
254
250
j = jiffies ;
255
- mdelay (longdelay_ms );
251
+ mdelay (long_hold );
256
252
pr_alert ("%s: delay = %lu jiffies.\n" , __func__ , jiffies - j );
257
253
}
258
254
if (!(torture_random (trsp ) % (cxt .nrealwriters_stress * 200 * shortdelay_us )))
@@ -370,14 +366,12 @@ __acquires(torture_rwlock)
370
366
static void torture_rwlock_write_delay (struct torture_random_state * trsp )
371
367
{
372
368
const unsigned long shortdelay_us = 2 ;
373
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
374
369
375
370
/* We want a short delay mostly to emulate likely code, and
376
371
* we want a long delay occasionally to force massive contention.
377
372
*/
378
- if (!(torture_random (trsp ) %
379
- (cxt .nrealwriters_stress * 2000 * longdelay_ms )))
380
- mdelay (longdelay_ms );
373
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold )))
374
+ mdelay (long_hold );
381
375
else
382
376
udelay (shortdelay_us );
383
377
}
@@ -398,14 +392,12 @@ __acquires(torture_rwlock)
398
392
static void torture_rwlock_read_delay (struct torture_random_state * trsp )
399
393
{
400
394
const unsigned long shortdelay_us = 10 ;
401
- const unsigned long longdelay_ms = 100 ;
402
395
403
396
/* We want a short delay mostly to emulate likely code, and
404
397
* we want a long delay occasionally to force massive contention.
405
398
*/
406
- if (!(torture_random (trsp ) %
407
- (cxt .nrealreaders_stress * 2000 * longdelay_ms )))
408
- mdelay (longdelay_ms );
399
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealreaders_stress * 2000 * long_hold )))
400
+ mdelay (long_hold );
409
401
else
410
402
udelay (shortdelay_us );
411
403
}
@@ -503,12 +495,9 @@ __acquires(torture_mutex)
503
495
504
496
static void torture_mutex_delay (struct torture_random_state * trsp )
505
497
{
506
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
507
-
508
498
/* We want a long delay occasionally to force massive contention. */
509
- if (!(torture_random (trsp ) %
510
- (cxt .nrealwriters_stress * 2000 * longdelay_ms )))
511
- mdelay (longdelay_ms * 5 );
499
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold )))
500
+ mdelay (long_hold * 5 );
512
501
if (!(torture_random (trsp ) % (cxt .nrealwriters_stress * 20000 )))
513
502
torture_preempt_schedule (); /* Allow test to be preempted. */
514
503
}
@@ -676,15 +665,13 @@ __acquires(torture_rtmutex)
676
665
static void torture_rtmutex_delay (struct torture_random_state * trsp )
677
666
{
678
667
const unsigned long shortdelay_us = 2 ;
679
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
680
668
681
669
/*
682
670
* We want a short delay mostly to emulate likely code, and
683
671
* we want a long delay occasionally to force massive contention.
684
672
*/
685
- if (!(torture_random (trsp ) %
686
- (cxt .nrealwriters_stress * 2000 * longdelay_ms )))
687
- mdelay (longdelay_ms );
673
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold )))
674
+ mdelay (long_hold );
688
675
if (!(torture_random (trsp ) %
689
676
(cxt .nrealwriters_stress * 200 * shortdelay_us )))
690
677
udelay (shortdelay_us );
@@ -741,12 +728,9 @@ __acquires(torture_rwsem)
741
728
742
729
static void torture_rwsem_write_delay (struct torture_random_state * trsp )
743
730
{
744
- const unsigned long longdelay_ms = long_hold ? long_hold : ULONG_MAX ;
745
-
746
731
/* We want a long delay occasionally to force massive contention. */
747
- if (!(torture_random (trsp ) %
748
- (cxt .nrealwriters_stress * 2000 * longdelay_ms )))
749
- mdelay (longdelay_ms * 10 );
732
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealwriters_stress * 2000 * long_hold )))
733
+ mdelay (long_hold * 10 );
750
734
if (!(torture_random (trsp ) % (cxt .nrealwriters_stress * 20000 )))
751
735
torture_preempt_schedule (); /* Allow test to be preempted. */
752
736
}
@@ -766,14 +750,11 @@ __acquires(torture_rwsem)
766
750
767
751
static void torture_rwsem_read_delay (struct torture_random_state * trsp )
768
752
{
769
- const unsigned long longdelay_ms = 100 ;
770
-
771
753
/* We want a long delay occasionally to force massive contention. */
772
- if (!(torture_random (trsp ) %
773
- (cxt .nrealreaders_stress * 2000 * longdelay_ms )))
774
- mdelay (longdelay_ms * 2 );
754
+ if (long_hold && !(torture_random (trsp ) % (cxt .nrealreaders_stress * 2000 * long_hold )))
755
+ mdelay (long_hold * 2 );
775
756
else
776
- mdelay (longdelay_ms / 2 );
757
+ mdelay (long_hold / 2 );
777
758
if (!(torture_random (trsp ) % (cxt .nrealreaders_stress * 20000 )))
778
759
torture_preempt_schedule (); /* Allow test to be preempted. */
779
760
}
@@ -1056,11 +1037,12 @@ lock_torture_print_module_parms(struct lock_torture_ops *cur_ops,
1056
1037
1057
1038
cpumask_setall (& cpumask_all );
1058
1039
pr_alert ("%s" TORTURE_FLAG
1059
- "--- %s%s: nwriters_stress =%d nreaders_stress =%d nested_locks=%d stat_interval =%d verbose =%d shuffle_interval =%d stutter =%d shutdown_secs=%d onoff_interval =%d onoff_holdoff =%d readers_bind=%*pbl writers_bind=%*pbl\n" ,
1040
+ "--- %s%s: acq_writer_lim =%d long_hold =%d nested_locks=%d nreaders_stress =%d nwriters_stress =%d onoff_holdoff =%d onoff_interval =%d rt_boost=%d rt_boost_factor=%d shuffle_interval=%d shutdown_secs=%d stat_interval =%d stutter=%d verbose=%d writer_fifo =%d readers_bind=%*pbl writers_bind=%*pbl\n" ,
1060
1041
torture_type , tag , cxt .debug_lock ? " [debug]" : "" ,
1061
- cxt .nrealwriters_stress , cxt .nrealreaders_stress ,
1062
- nested_locks , stat_interval , verbose , shuffle_interval ,
1063
- stutter , shutdown_secs , onoff_interval , onoff_holdoff ,
1042
+ acq_writer_lim , long_hold , nested_locks , cxt .nrealreaders_stress ,
1043
+ cxt .nrealwriters_stress , onoff_holdoff , onoff_interval , rt_boost ,
1044
+ rt_boost_factor , shuffle_interval , shutdown_secs , stat_interval , stutter ,
1045
+ verbose , writer_fifo ,
1064
1046
cpumask_pr_args (rcmp ), cpumask_pr_args (wcmp ));
1065
1047
}
1066
1048
0 commit comments