[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f58a2fcb-2306-4c27-a20c-11ac953c1b5d@suse.cz>
Date: Thu, 13 Nov 2025 17:12:18 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Christoph Hellwig <hch@....de>, Andrew Morton <akpm@...ux-foundation.org>
Cc: Christoph Lameter <cl@...two.org>, David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>, Harry Yoo <harry.yoo@...cle.com>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Brendan Jackman <jackmanb@...gle.com>, Zi Yan <ziy@...dia.com>,
Eric Biggers <ebiggers@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: mempool_alloc_bulk and various mempool improvements v3
On 11/13/25 09:39, Christoph Hellwig wrote:
> Hi all,
>
> this series adds a bulk version of mempool_alloc that makes allocating
> multiple objects deadlock safe.
>
> The initial users is the blk-crypto-fallback code:
>
> https://lore.kernel.org/linux-block/20251031093517.1603379-1-hch@lst.de/
>
> with which v1 was posted, but I also have a few other users in mind.
>
> Changes since v2:
> - improve the alloc_pages_bulk documentation a bit
> - drop the not needed race fix again
> - drop the gfp_mask argument to mempool_alloc_bulk to reduce misuse
> potential
> - add an allocated argument to mempool_alloc_bulk
> - drop the caller_ip handling that was already not required since the
> last version
> - add a few more mempool cleanups
LGTM now.
Since mempool is now part of SLAB in MAINTAINERS, added to slab/for-next.
Thanks!
> Changes since v1:
> - fix build for !CONFIG_FAULT_INJECTION
> - improve the kerneldoc comments further
> - refactor the code so that the mempool_alloc fastpath does not
> have to deal with arrays
> - don't support !__GFP_DIRECT_RECLAIM for bulk allocations
> - do poll allocations even if not all elements are available
> - s/elem/elems/
> - use a separate failure injection know for the bulk allocator
>
> diffstat:
> include/linux/fault-inject.h | 8
> include/linux/mempool.h | 58 ++----
> mm/mempool.c | 401 ++++++++++++++++++++++++++-----------------
> mm/page_alloc.c | 15 +
> 4 files changed, 289 insertions(+), 193 deletions(-)
Powered by blists - more mailing lists