Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/rsrc: use kvfree() for the imu cache

Currently anything that requires kvmalloc_flex() for allocations will
not get re-cached, and hence the cache freeing path is correct in that
it always uses kfree() to free the allocated memory. But this seems a
bit fragile as it's something that could get mix should that situation
change, so switch io_free_imu() and io_alloc_cache_free() to use kvfree
as the desctructor.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+2 -2
+1 -1
io_uring/alloc_cache.h
··· 64 64 static inline void io_cache_free(struct io_alloc_cache *cache, void *obj) 65 65 { 66 66 if (!io_alloc_cache_put(cache, obj)) 67 - kfree(obj); 67 + kvfree(obj); 68 68 } 69 69 70 70 #endif
+1 -1
io_uring/rsrc.c
··· 168 168 void io_rsrc_cache_free(struct io_ring_ctx *ctx) 169 169 { 170 170 io_alloc_cache_free(&ctx->node_cache, kfree); 171 - io_alloc_cache_free(&ctx->imu_cache, kfree); 171 + io_alloc_cache_free(&ctx->imu_cache, kvfree); 172 172 } 173 173 174 174 static void io_clear_table_tags(struct io_rsrc_data *data)