Lines Matching refs:stress
342 struct stress { struct
373 static void dummy_load(struct stress *stress) in dummy_load() argument
380 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
381 const int nlocks = stress->nlocks; in stress_inorder_work()
382 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
406 dummy_load(stress); in stress_inorder_work()
426 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
429 kfree(stress); in stress_inorder_work()
439 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
446 order = get_random_order(stress->nlocks); in stress_reorder_work()
450 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
455 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
483 dummy_load(stress); in stress_reorder_work()
488 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
494 kfree(stress); in stress_reorder_work()
499 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
500 const int nlocks = stress->nlocks; in stress_one_work()
501 struct ww_mutex *lock = stress->locks + (get_random_int() % nlocks); in stress_one_work()
507 dummy_load(stress); in stress_one_work()
514 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
516 kfree(stress); in stress_one_work()
524 static int stress(int nlocks, int nthreads, unsigned int flags) in stress() function
537 struct stress *stress; in stress() local
559 stress = kmalloc(sizeof(*stress), GFP_KERNEL); in stress()
560 if (!stress) in stress()
563 INIT_WORK(&stress->work, fn); in stress()
564 stress->locks = locks; in stress()
565 stress->nlocks = nlocks; in stress()
566 stress->timeout = jiffies + 2*HZ; in stress()
568 queue_work(wq, &stress->work); in stress()
610 ret = stress(16, 2*ncpus, STRESS_INORDER); in test_ww_mutex_init()
614 ret = stress(16, 2*ncpus, STRESS_REORDER); in test_ww_mutex_init()
618 ret = stress(4095, hweight32(STRESS_ALL)*ncpus, STRESS_ALL); in test_ww_mutex_init()