Re: [PATCH 2/3] mm: support fallible mempool_alloc_bulk()
From: Eric Biggers
Date: Tue Aug 11 2026 - 17:05:58 EST
On Tue, Aug 11, 2026 at 01:13:37PM -0700, Christoph Hellwig wrote:
> What is actually efficient is do skip the mempool entirely from the
> original submission context and do a non-mempool GFP_NOIO allocation,
> and only in the extremely unlikely case that this fails fall back to
> the rescruer thread.
It definitely is *not* more efficient to fall back to a kworker for a
small task (removing elements from a mempool that has them available)
that could just be done synchronously. Scheduling overhead is a huge
problem for kernel features doing I/O pre or post-processing. The idea
that scheduling a kworker is lightweight compared to the actual I/O is
quite outdated.
Sure, this case triggers only when the regular allocations fail anyway.
So it shouldn't be a big deal, and I'll send a patch that implements it
the less efficient way that you prefer. But it's a little unfortunate
that you're not going to allow it to be implemented properly.
- Eric