Re: [PATCH 2/3] mm: support fallible mempool_alloc_bulk()

Eric Biggers <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <20260811210338.GB1905@sol>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.