Lines Matching refs:stress

389 struct stress {  struct
431 static void dummy_load(struct stress *stress) in dummy_load() argument
438 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
439 const int nlocks = stress->nlocks; in stress_inorder_work()
440 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
452 ww_acquire_init(&ctx, stress->class); in stress_inorder_work()
464 dummy_load(stress); in stress_inorder_work()
473 if (!time_after(jiffies, stress->timeout)) { in stress_inorder_work()
485 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
497 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
504 order = get_random_order(stress->nlocks); in stress_reorder_work()
508 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
513 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
520 ww_acquire_init(&ctx, stress->class); in stress_reorder_work()
541 dummy_load(stress); in stress_reorder_work()
546 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
556 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
557 const int nlocks = stress->nlocks; in stress_one_work()
558 struct ww_mutex *lock = stress->locks + get_random_u32_below(nlocks); in stress_one_work()
564 dummy_load(stress); in stress_one_work()
571 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
579 static int stress(struct ww_class *class, int nlocks, int nthreads, unsigned int flags) in stress() function
582 struct stress *stress_array; in stress()
600 struct stress *stress; in stress() local
622 stress = &stress_array[count++]; in stress()
624 INIT_WORK(&stress->work, fn); in stress()
625 stress->class = class; in stress()
626 stress->locks = locks; in stress()
627 stress->nlocks = nlocks; in stress()
628 stress->timeout = jiffies + 2*HZ; in stress()
630 queue_work(wq, &stress->work); in stress()
671 ret = stress(class, 16, 2 * ncpus, STRESS_INORDER); in run_tests()
675 ret = stress(class, 16, 2 * ncpus, STRESS_REORDER); in run_tests()
679 ret = stress(class, 2046, hweight32(STRESS_ALL) * ncpus, STRESS_ALL); in run_tests()