Lines Matching refs:tdata
586 static int thread_lookup_test(struct thread_data *tdata) in thread_lookup_test() argument
588 unsigned int entries = tdata->entries; in thread_lookup_test()
595 .tid = tdata->id, in thread_lookup_test()
599 if (obj && (tdata->objs[i].value.id == TEST_INSERT_FAIL)) { in thread_lookup_test()
602 } else if (!obj && (tdata->objs[i].value.id != TEST_INSERT_FAIL)) { in thread_lookup_test()
619 struct thread_data *tdata = data; in threadfunc() local
624 pr_err(" thread[%d]: interrupted\n", tdata->id); in threadfunc()
628 for (i = 0; i < tdata->entries; i++) { in threadfunc()
629 tdata->objs[i].value.id = i; in threadfunc()
630 tdata->objs[i].value.tid = tdata->id; in threadfunc()
631 err = insert_retry(&ht, &tdata->objs[i], test_rht_params); in threadfunc()
636 tdata->id); in threadfunc()
642 tdata->id, insert_retries); in threadfunc()
644 err = thread_lookup_test(tdata); in threadfunc()
647 tdata->id); in threadfunc()
652 for (i = 0; i < tdata->entries; i += step) { in threadfunc()
653 if (tdata->objs[i].value.id == TEST_INSERT_FAIL) in threadfunc()
655 err = rhashtable_remove_fast(&ht, &tdata->objs[i].node, in threadfunc()
659 tdata->id); in threadfunc()
662 tdata->objs[i].value.id = TEST_INSERT_FAIL; in threadfunc()
666 err = thread_lookup_test(tdata); in threadfunc()
669 tdata->id); in threadfunc()
686 struct thread_data *tdata; in test_rht_init() local
746 tdata = vzalloc(array_size(tcount, sizeof(struct thread_data))); in test_rht_init()
747 if (!tdata) in test_rht_init()
751 vfree(tdata); in test_rht_init()
761 vfree(tdata); in test_rht_init()
766 tdata[i].id = i; in test_rht_init()
767 tdata[i].entries = entries; in test_rht_init()
768 tdata[i].objs = objs + i * entries; in test_rht_init()
769 tdata[i].task = kthread_run(threadfunc, &tdata[i], in test_rht_init()
771 if (IS_ERR(tdata[i].task)) { in test_rht_init()
784 if (IS_ERR(tdata[i].task)) in test_rht_init()
786 if ((err = kthread_stop(tdata[i].task))) { in test_rht_init()
793 vfree(tdata); in test_rht_init()