Lines Matching refs:test_cache
167 static struct kmem_cache *test_cache; variable
183 test_cache = kmem_cache_create("test", size, 1, flags, ctor); in setup_test_cache()
184 KUNIT_ASSERT_TRUE_MSG(test, test_cache, "could not create cache"); in setup_test_cache()
191 if (!test_cache) in test_cache_destroy()
194 kmem_cache_destroy(test_cache); in test_cache_destroy()
195 test_cache = NULL; in test_cache_destroy()
206 if (test_cache) in test_free()
207 kmem_cache_free(test_cache, ptr); in test_free()
249 policy_name, !!test_cache); in test_alloc()
263 if (test_cache) in test_alloc()
264 alloc = kmem_cache_alloc(test_cache, gfp); in test_alloc()
270 …struct kmem_cache *s = test_cache ?: kmalloc_caches[kmalloc_type(GFP_KERNEL)][kmalloc_index(size)]; in test_alloc()
316 if (!test_cache) in test_out_of_bounds_read()
499 KUNIT_EXPECT_TRUE(test, test_cache); in test_shrink_memcache()
501 kmem_cache_shrink(test_cache); in test_shrink_memcache()
529 kmem_cache_free_bulk(test_cache, ARRAY_SIZE(objects), objects); in test_free_bulk()
650 KUNIT_EXPECT_TRUE(test, test_cache); /* Want memcache. */ in test_memcache_typesafe_by_rcu()
688 KUNIT_EXPECT_FALSE(test, test_cache); in test_krealloc()
723 KUNIT_EXPECT_TRUE(test, test_cache); /* Want memcache. */ in test_memcache_alloc_bulk()
731 int i, num = kmem_cache_alloc_bulk(test_cache, GFP_ATOMIC, ARRAY_SIZE(objects), in test_memcache_alloc_bulk()
741 kmem_cache_free_bulk(test_cache, num, objects); in test_memcache_alloc_bulk()