Lines Matching refs:n
320 unsigned int n, last = nthreads - 1; in __test_cycle() local
327 for (n = 0; n < nthreads; n++) { in __test_cycle()
328 struct test_cycle *cycle = &cycles[n]; in __test_cycle()
331 if (n == last) in __test_cycle()
334 cycle->b_mutex = &cycles[n + 1].a_mutex; in __test_cycle()
336 if (n == 0) in __test_cycle()
339 cycle->a_signal = &cycles[n - 1].b_signal; in __test_cycle()
346 for (n = 0; n < nthreads; n++) in __test_cycle()
347 queue_work(wq, &cycles[n].work); in __test_cycle()
352 for (n = 0; n < nthreads; n++) { in __test_cycle()
353 struct test_cycle *cycle = &cycles[n]; in __test_cycle()
359 n, nthreads, cycle->result); in __test_cycle()
364 for (n = 0; n < nthreads; n++) in __test_cycle()
365 ww_mutex_destroy(&cycles[n].a_mutex); in __test_cycle()
372 unsigned int n; in test_cycle() local
375 for (n = 2; n <= ncpus + 1; n++) { in test_cycle()
376 ret = __test_cycle(n); in test_cycle()
407 int n, r; in get_random_order() local
413 for (n = 0; n < count; n++) in get_random_order()
414 order[n] = n; in get_random_order()
416 for (n = count - 1; n > 1; n--) { in get_random_order()
417 r = prandom_u32_below(n + 1); in get_random_order()
418 if (r != n) in get_random_order()
419 swap(order[n], order[r]); in get_random_order()
444 int n, err; in stress_inorder_work() local
449 for (n = 0; n < nlocks; n++) { in stress_inorder_work()
450 if (n == contended) in stress_inorder_work()
453 err = ww_mutex_lock(&locks[order[n]], &ctx); in stress_inorder_work()
460 if (contended > n) in stress_inorder_work()
462 contended = n; in stress_inorder_work()
463 while (n--) in stress_inorder_work()
464 ww_mutex_unlock(&locks[order[n]]); in stress_inorder_work()
496 int n, err; in stress_reorder_work() local
502 for (n = 0; n < stress->nlocks; n++) { in stress_reorder_work()
507 ll->lock = &stress->locks[order[n]]; in stress_reorder_work()
577 int n, count; in stress() local
590 for (n = 0; n < nlocks; n++) in stress()
591 ww_mutex_init(&locks[n], &ww_class); in stress()
594 for (n = 0; nthreads; n++) { in stress()
599 switch (n & 3) { in stress()
630 for (n = 0; n < nlocks; n++) in stress()
631 ww_mutex_destroy(&locks[n]); in stress()