diff options
Diffstat (limited to 'kernel/locking/locktorture.c')
| -rw-r--r-- | kernel/locking/locktorture.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index f26b1a18e34e..dbafeac18e4d 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c | |||
| @@ -82,14 +82,14 @@ struct lock_writer_stress_stats { | |||
| 82 | }; | 82 | }; |
| 83 | static struct lock_writer_stress_stats *lwsa; | 83 | static struct lock_writer_stress_stats *lwsa; |
| 84 | 84 | ||
| 85 | #if defined(MODULE) || defined(CONFIG_LOCK_TORTURE_TEST_RUNNABLE) | 85 | #if defined(MODULE) |
| 86 | #define LOCKTORTURE_RUNNABLE_INIT 1 | 86 | #define LOCKTORTURE_RUNNABLE_INIT 1 |
| 87 | #else | 87 | #else |
| 88 | #define LOCKTORTURE_RUNNABLE_INIT 0 | 88 | #define LOCKTORTURE_RUNNABLE_INIT 0 |
| 89 | #endif | 89 | #endif |
| 90 | int locktorture_runnable = LOCKTORTURE_RUNNABLE_INIT; | 90 | int locktorture_runnable = LOCKTORTURE_RUNNABLE_INIT; |
| 91 | module_param(locktorture_runnable, int, 0444); | 91 | module_param(locktorture_runnable, int, 0444); |
| 92 | MODULE_PARM_DESC(locktorture_runnable, "Start locktorture at boot"); | 92 | MODULE_PARM_DESC(locktorture_runnable, "Start locktorture at module init"); |
| 93 | 93 | ||
| 94 | /* Forward reference. */ | 94 | /* Forward reference. */ |
| 95 | static void lock_torture_cleanup(void); | 95 | static void lock_torture_cleanup(void); |
| @@ -219,7 +219,8 @@ static int lock_torture_writer(void *arg) | |||
| 219 | set_user_nice(current, 19); | 219 | set_user_nice(current, 19); |
| 220 | 220 | ||
| 221 | do { | 221 | do { |
| 222 | schedule_timeout_uninterruptible(1); | 222 | if ((torture_random(&rand) & 0xfffff) == 0) |
| 223 | schedule_timeout_uninterruptible(1); | ||
| 223 | cur_ops->writelock(); | 224 | cur_ops->writelock(); |
| 224 | if (WARN_ON_ONCE(lock_is_write_held)) | 225 | if (WARN_ON_ONCE(lock_is_write_held)) |
| 225 | lwsp->n_write_lock_fail++; | 226 | lwsp->n_write_lock_fail++; |
| @@ -354,7 +355,8 @@ static int __init lock_torture_init(void) | |||
| 354 | &lock_busted_ops, &spin_lock_ops, &spin_lock_irq_ops, | 355 | &lock_busted_ops, &spin_lock_ops, &spin_lock_irq_ops, |
| 355 | }; | 356 | }; |
| 356 | 357 | ||
| 357 | torture_init_begin(torture_type, verbose, &locktorture_runnable); | 358 | if (!torture_init_begin(torture_type, verbose, &locktorture_runnable)) |
| 359 | return -EBUSY; | ||
| 358 | 360 | ||
| 359 | /* Process args and tell the world that the torturer is on the job. */ | 361 | /* Process args and tell the world that the torturer is on the job. */ |
| 360 | for (i = 0; i < ARRAY_SIZE(torture_ops); i++) { | 362 | for (i = 0; i < ARRAY_SIZE(torture_ops); i++) { |
