Lines Matching refs:stress

382 struct stress {  struct
426 static void dummy_load(struct stress *stress) in dummy_load() argument
433 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
434 const int nlocks = stress->nlocks; in stress_inorder_work()
435 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
459 dummy_load(stress); in stress_inorder_work()
468 if (!time_after(jiffies, stress->timeout)) { in stress_inorder_work()
480 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
492 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
499 order = get_random_order(stress->nlocks); in stress_reorder_work()
503 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
508 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
536 dummy_load(stress); in stress_reorder_work()
541 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
551 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
552 const int nlocks = stress->nlocks; in stress_one_work()
553 struct ww_mutex *lock = stress->locks + get_random_u32_below(nlocks); in stress_one_work()
559 dummy_load(stress); in stress_one_work()
566 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
574 static int stress(int nlocks, int nthreads, unsigned int flags) in stress() function
577 struct stress *stress_array; in stress()
596 struct stress *stress; in stress() local
618 stress = &stress_array[count++]; in stress()
620 INIT_WORK(&stress->work, fn); in stress()
621 stress->locks = locks; in stress()
622 stress->nlocks = nlocks; in stress()
623 stress->timeout = jiffies + 2*HZ; in stress()
625 queue_work(wq, &stress->work); in stress()
674 ret = stress(16, 2*ncpus, STRESS_INORDER); in test_ww_mutex_init()
678 ret = stress(16, 2*ncpus, STRESS_REORDER); in test_ww_mutex_init()
682 ret = stress(2047, hweight32(STRESS_ALL)*ncpus, STRESS_ALL); in test_ww_mutex_init()