Lines Matching refs:stress
355 struct stress { struct
386 static void dummy_load(struct stress *stress) in dummy_load() argument
393 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
394 const int nlocks = stress->nlocks; in stress_inorder_work()
395 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
419 dummy_load(stress); in stress_inorder_work()
439 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
442 kfree(stress); in stress_inorder_work()
452 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
459 order = get_random_order(stress->nlocks); in stress_reorder_work()
463 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
468 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
496 dummy_load(stress); in stress_reorder_work()
501 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
507 kfree(stress); in stress_reorder_work()
512 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
513 const int nlocks = stress->nlocks; in stress_one_work()
514 struct ww_mutex *lock = stress->locks + (get_random_int() % nlocks); in stress_one_work()
520 dummy_load(stress); in stress_one_work()
527 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
529 kfree(stress); in stress_one_work()
537 static int stress(int nlocks, int nthreads, unsigned int flags) in stress() function
550 struct stress *stress; in stress() local
572 stress = kmalloc(sizeof(*stress), GFP_KERNEL); in stress()
573 if (!stress) in stress()
576 INIT_WORK(&stress->work, fn); in stress()
577 stress->locks = locks; in stress()
578 stress->nlocks = nlocks; in stress()
579 stress->timeout = jiffies + 2*HZ; in stress()
581 queue_work(wq, &stress->work); in stress()
623 ret = stress(16, 2*ncpus, STRESS_INORDER); in test_ww_mutex_init()
627 ret = stress(16, 2*ncpus, STRESS_REORDER); in test_ww_mutex_init()
631 ret = stress(4095, hweight32(STRESS_ALL)*ncpus, STRESS_ALL); in test_ww_mutex_init()