Re: [PATCH 0/4] io_uring: improve alloc_cache branch prediction
From: Jens Axboe
Date: Mon Nov 09 2026 - 16:38:23 EST
On Tue, 03 Nov 2026 14:10:27 -0700, Caleb Sander Mateos wrote:
> A call to io_uring_alloc_async_data() that provides a struct io_alloc_cache
> currently has 2 unnecessary NULL checks in the fast path:
> - Of the struct io_alloc_cache *, even though it points to a struct io_ring_ctx
> field
> - Of the void * entry popped from the cache, even though all cache entries are
> non-NULL
> The compiler also incorrectly assumes the success path in io_alloc_cache_get()
> is the unlikely one because it's written as an early return.
>
> [...]
Applied, thanks!
[1/4] io_uring: split io_uring_alloc_async_data()
commit: 5b1d75482ccbc6483336d16cec609da2706981ab
[2/4] io_uring/alloc_cache: mark cache success paths as likely
commit: 2c4f39b09b031c94465e945bea50df5c781fafd4
[3/4] io_uring/alloc_cache: assume io_alloc_cache_get() doesn't return NULL
commit: e10a5108ae01eb9e166b0c7bc04fad6b0001095c
[4/4] io_uring/futex: avoid ifd NULL check in io_futex_wait()
commit: ddcc50dd41d331dc66e0e5793492c3fa09941ff9
Best regards,
--
Jens Axboe