On Mon, Apr 26, 2021 at 09:12:09AM -0600, Jens Axboe wrote: > Here's the series. It's not super clean (yet), but basically allows > users like io_uring to setup a bio cache, and pass that in through > iocb->ki_bi_cache. With that, we can recycle them instead of going > through free+alloc continually. If you look at profiles for high iops, > we're spending more time than desired doing just that. > > https://git.kernel.dk/cgit/linux-block/log/?h=io_uring-bio-cache So where do you spend the cycles? The do not memset the whole bio optimization is pretty obvious and is someting we should do independent of the allocator. The other thing that sucks is the mempool implementation, as it forces each allocation and free to do an indirect call. I think it might be worth to try to frontend it with a normal slab cache and only fall back to the mempool if that fails.