linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mempool_alloc_bulk and various mempool improvements v3
@ 2025-11-13  8:39 Christoph Hellwig
  2025-11-13  8:39 ` [PATCH 01/11] fault-inject: make enum fault_flags available unconditionally Christoph Hellwig
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Christoph Hellwig @ 2025-11-13  8:39 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton
  Cc: Christoph Lameter, David Rientjes, Roman Gushchin, Harry Yoo,
	Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Zi Yan,
	Eric Biggers, linux-mm, linux-kernel

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

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(-)


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-11-25 11:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-13  8:39 mempool_alloc_bulk and various mempool improvements v3 Christoph Hellwig
2025-11-13  8:39 ` [PATCH 01/11] fault-inject: make enum fault_flags available unconditionally Christoph Hellwig
2025-11-13  8:39 ` [PATCH 02/11] mm: improve kerneldoc comments for __alloc_pages_bulk Christoph Hellwig
2025-11-13  8:39 ` [PATCH 03/11] mempool: improve kerneldoc comments Christoph Hellwig
2025-11-13  8:39 ` [PATCH 04/11] mempool: add error injection support Christoph Hellwig
2025-11-13  8:39 ` [PATCH 05/11] mempool: factor out a mempool_adjust_gfp helper Christoph Hellwig
2025-11-13  8:39 ` [PATCH 06/11] mempool: factor out a mempool_alloc_from_pool helper Christoph Hellwig
2025-11-23  3:42   ` Hugh Dickins
2025-11-23 11:34     ` Vlastimil Babka
2025-11-23 17:49       ` Hugh Dickins
2025-11-23 21:22         ` Vlastimil Babka
2025-11-23 23:04           ` Hugh Dickins
2025-11-25 11:32             ` Vlastimil Babka
2025-11-24  6:17         ` Christoph Hellwig
2025-11-24  6:15       ` Christoph Hellwig
2025-11-25 11:34         ` Vlastimil Babka
2025-11-24  6:14     ` Christoph Hellwig
2025-11-13  8:39 ` [PATCH 07/11] mempool: add mempool_{alloc,free}_bulk Christoph Hellwig
2025-11-13  8:39 ` [PATCH 08/11] mempool: legitimize the io_schedule_timeout in mempool_alloc_from_pool Christoph Hellwig
2025-11-13  8:39 ` [PATCH 09/11] mempool: remove mempool_{init,create}_kvmalloc_pool Christoph Hellwig
2025-11-13  8:39 ` [PATCH 10/11] mempool: de-typedef Christoph Hellwig
2025-11-13  8:39 ` [PATCH 11/11] mempool: drop the file name in the top of file comment Christoph Hellwig
2025-11-13 16:12 ` mempool_alloc_bulk and various mempool improvements v3 Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox