Re: [PATCH 7/7] mempool: add mempool_{alloc,free}_bulk

From: Christoph Hellwig

Date: Wed Nov 12 2025 - 10:58:23 EST


On Wed, Nov 12, 2025 at 04:56:19PM +0100, Vlastimil Babka wrote:
> > and doesn't leave random holes? That's what a quick look at the code
> > suggest, unfortunately the documentation for it totally sucks.
>
> Yeah I think it's fine with alloc_pages_bulk. It would only be a concern is
> the bulk alloc+mempool user used up part of the allocated array, NULLing
> some earlier pointers but leaving later ones alone, and then attempted to
> refill it.

We could have a sanity check for that. The cache line is hot anyway,
so another few NULL checks aren't going to cost us much.