Re: [RFC PATCH 1/3] io_uring/rsrc: allocate io_rsrc_node from a dedicated kmem_cache

From: Uzair Beg

Date: Fri Sep 25 2026 - 12:42:31 EST


Gabriel Krisman Bertazi <krisman@xxxxxxx> writes:

> Not opposed to having a slab, but I actually think it is
> unnecessary. see patch 2. If we do that, we actually should delete the
> async_size parameter in the opdef, since it is now redundant. But
> see comments in patch 2.

Sorry for the slow reply, and thanks for the review. I couldn't find
your comments on 2/3, either in my inbox or on lore, so I may have
missed them. Could you resend?

For context, 1/3 and 2/3 were both neutral on their own and exist only
to support 3/3. If 3/3 changes shape as discussed in that thread, I
expect to drop both.

> FWIW, this is exactly why we have the (*free) callback, you should have a function
> for your specific type used as a callback that does the kmem_cache_free
> so you don't need the if/else here.
>
> But for a simple kmem_cache_free, kfree works just fine.

Agreed on both. I was guarding against a mismatch that kfree() already
handles for kmem_cache objects, so the free paths did not need touching.