Lines Matching refs:test_cache
184 static struct kmem_cache *test_cache; variable
199 test_cache = kmem_cache_create("test", size, 1, flags, ctor); in setup_test_cache()
200 KUNIT_ASSERT_TRUE_MSG(test, test_cache, "could not create cache"); in setup_test_cache()
207 if (!test_cache) in test_cache_destroy()
210 kmem_cache_destroy(test_cache); in test_cache_destroy()
211 test_cache = NULL; in test_cache_destroy()
224 if (test_cache) in test_free()
225 kmem_cache_free(test_cache, ptr); in test_free()
267 policy_name, !!test_cache); in test_alloc()
281 if (test_cache) in test_alloc()
282 alloc = kmem_cache_alloc(test_cache, gfp); in test_alloc()
289 struct kmem_cache *s = test_cache ?: in test_alloc()
335 if (!test_cache) in test_out_of_bounds_read()
534 KUNIT_EXPECT_TRUE(test, test_cache); in test_shrink_memcache()
536 kmem_cache_shrink(test_cache); in test_shrink_memcache()
564 kmem_cache_free_bulk(test_cache, ARRAY_SIZE(objects), objects); in test_free_bulk()
683 KUNIT_EXPECT_TRUE(test, test_cache); /* Want memcache. */ in test_memcache_typesafe_by_rcu()
721 KUNIT_EXPECT_FALSE(test, test_cache); in test_krealloc()
756 KUNIT_EXPECT_TRUE(test, test_cache); /* Want memcache. */ in test_memcache_alloc_bulk()
764 int i, num = kmem_cache_alloc_bulk(test_cache, GFP_ATOMIC, ARRAY_SIZE(objects), in test_memcache_alloc_bulk()
774 kmem_cache_free_bulk(test_cache, num, objects); in test_memcache_alloc_bulk()