Lines Matching refs:stress
382 struct stress { struct
413 static void dummy_load(struct stress *stress) in dummy_load() argument
420 struct stress *stress = container_of(work, typeof(*stress), work); in stress_inorder_work() local
421 const int nlocks = stress->nlocks; in stress_inorder_work()
422 struct ww_mutex *locks = stress->locks; in stress_inorder_work()
446 dummy_load(stress); in stress_inorder_work()
466 } while (!time_after(jiffies, stress->timeout)); in stress_inorder_work()
469 kfree(stress); in stress_inorder_work()
479 struct stress *stress = container_of(work, typeof(*stress), work); in stress_reorder_work() local
486 order = get_random_order(stress->nlocks); in stress_reorder_work()
490 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
495 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
523 dummy_load(stress); in stress_reorder_work()
528 } while (!time_after(jiffies, stress->timeout)); in stress_reorder_work()
534 kfree(stress); in stress_reorder_work()
539 struct stress *stress = container_of(work, typeof(*stress), work); in stress_one_work() local
540 const int nlocks = stress->nlocks; in stress_one_work()
541 struct ww_mutex *lock = stress->locks + prandom_u32_max(nlocks); in stress_one_work()
547 dummy_load(stress); in stress_one_work()
554 } while (!time_after(jiffies, stress->timeout)); in stress_one_work()
556 kfree(stress); in stress_one_work()
564 static int stress(int nlocks, int nthreads, unsigned int flags) in stress() function
577 struct stress *stress; in stress() local
599 stress = kmalloc(sizeof(*stress), GFP_KERNEL); in stress()
600 if (!stress) in stress()
603 INIT_WORK(&stress->work, fn); in stress()
604 stress->locks = locks; in stress()
605 stress->nlocks = nlocks; in stress()
606 stress->timeout = jiffies + 2*HZ; in stress()
608 queue_work(wq, &stress->work); in stress()
654 ret = stress(16, 2*ncpus, STRESS_INORDER); in test_ww_mutex_init()
658 ret = stress(16, 2*ncpus, STRESS_REORDER); in test_ww_mutex_init()
662 ret = stress(4095, hweight32(STRESS_ALL)*ncpus, STRESS_ALL); in test_ww_mutex_init()