Lines Matching full:cycle
248 struct test_cycle *cycle = container_of(work, typeof(*cycle), work); in test_cycle_work() local
253 ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
255 complete(cycle->a_signal); in test_cycle_work()
256 wait_for_completion(&cycle->b_signal); in test_cycle_work()
258 err = ww_mutex_lock(cycle->b_mutex, &ctx); in test_cycle_work()
261 ww_mutex_unlock(&cycle->a_mutex); in test_cycle_work()
262 ww_mutex_lock_slow(cycle->b_mutex, &ctx); in test_cycle_work()
263 erra = ww_mutex_lock(&cycle->a_mutex, &ctx); in test_cycle_work()
267 ww_mutex_unlock(cycle->b_mutex); in test_cycle_work()
269 ww_mutex_unlock(&cycle->a_mutex); in test_cycle_work()
272 cycle->result = err ?: erra; in test_cycle_work()
286 struct test_cycle *cycle = &cycles[n]; in __test_cycle() local
288 ww_mutex_init(&cycle->a_mutex, &ww_class); in __test_cycle()
290 cycle->b_mutex = &cycles[0].a_mutex; in __test_cycle()
292 cycle->b_mutex = &cycles[n + 1].a_mutex; in __test_cycle()
295 cycle->a_signal = &cycles[last].b_signal; in __test_cycle()
297 cycle->a_signal = &cycles[n - 1].b_signal; in __test_cycle()
298 init_completion(&cycle->b_signal); in __test_cycle()
300 INIT_WORK(&cycle->work, test_cycle_work); in __test_cycle()
301 cycle->result = 0; in __test_cycle()
311 struct test_cycle *cycle = &cycles[n]; in __test_cycle() local
313 if (!cycle->result) in __test_cycle()
317 n, nthreads, cycle->result); in __test_cycle()