Lines Matching full:cycle
288 struct test_cycle *cycle = container_of(work, typeof(*cycle), work); in test_cycle_work() local
293 ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
295 complete(cycle->a_signal); in test_cycle_work()
296 wait_for_completion(&cycle->b_signal); in test_cycle_work()
298 err = ww_mutex_lock(cycle->b_mutex, &ctx); in test_cycle_work()
301 ww_mutex_unlock(&cycle->a_mutex); in test_cycle_work()
302 ww_mutex_lock_slow(cycle->b_mutex, &ctx); in test_cycle_work()
303 erra = ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
307 ww_mutex_unlock(cycle->b_mutex); in test_cycle_work()
309 ww_mutex_unlock(&cycle->a_mutex); in test_cycle_work()
312 cycle->result = err ?: erra; in test_cycle_work()
326 struct test_cycle *cycle = &cycles[n]; in __test_cycle() local
328 ww_mutex_init(&cycle->a_mutex, &ww_class); in __test_cycle()
330 cycle->b_mutex = &cycles[0].a_mutex; in __test_cycle()
332 cycle->b_mutex = &cycles[n + 1].a_mutex; in __test_cycle()
335 cycle->a_signal = &cycles[last].b_signal; in __test_cycle()
337 cycle->a_signal = &cycles[n - 1].b_signal; in __test_cycle()
338 init_completion(&cycle->b_signal); in __test_cycle()
340 INIT_WORK(&cycle->work, test_cycle_work); in __test_cycle()
341 cycle->result = 0; in __test_cycle()
351 struct test_cycle *cycle = &cycles[n]; in __test_cycle() local
353 if (!cycle->result) in __test_cycle()
357 n, nthreads, cycle->result); in __test_cycle()