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

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-block,org.kvack.linux-mm
Message-ID <[email protected]>
On Tue, Aug 11, 2026 at 02:03:38PM -0700, Eric Biggers wrote:
> 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.

That is not the point.  The point is that mempool_alloc_bulk frequently
fails to allocate all pages, and just filling that with a plain
alloc_pages is way faster than calling into the mempool code in any
form.  The case where we actually need the mempool entries is extremely
rare.
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.