Lines Matching full:stress
384 struct stress { struct
425 static void dummy_load(struct stress *stress) in dummy_load() argument
432 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
433 const int nlocks = stress->nlocks; in stress_inorder_work()
434 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
458 dummy_load(stress); in stress_inorder_work()
467 if (!time_after(jiffies, stress->timeout)) { in stress_inorder_work()
475 pr_err_once("stress (%s) failed with %d\n", in stress_inorder_work()
479 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
491 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
498 order = get_random_order(stress->nlocks); in stress_reorder_work()
502 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
507 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
526 pr_err_once("stress (%s) failed with %d\n", in stress_reorder_work()
535 dummy_load(stress); in stress_reorder_work()
540 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
550 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
551 const int nlocks = stress->nlocks; in stress_one_work()
552 struct ww_mutex *lock = stress->locks + get_random_u32_below(nlocks); in stress_one_work()
558 dummy_load(stress); in stress_one_work()
561 pr_err_once("stress (%s) failed with %d\n", in stress_one_work()
565 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
573 static int stress(int nlocks, int nthreads, unsigned int flags) in stress() function
576 struct stress *stress_array; in stress()
595 struct stress *stress; in stress() local
617 stress = &stress_array[count++]; in stress()
619 INIT_WORK(&stress->work, fn); in stress()
620 stress->locks = locks; in stress()
621 stress->nlocks = nlocks; in stress()
622 stress->timeout = jiffies + 2*HZ; in stress()
624 queue_work(wq, &stress->work); in stress()
673 ret = stress(16, 2*ncpus, STRESS_INORDER); in test_ww_mutex_init()
677 ret = stress(16, 2*ncpus, STRESS_REORDER); in test_ww_mutex_init()
681 ret = stress(2046, hweight32(STRESS_ALL)*ncpus, STRESS_ALL); in test_ww_mutex_init()