linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mempool_alloc_bulk and various mempool improvements
@ 2025-11-11 13:52 Christoph Hellwig
  2025-11-11 13:52 ` [PATCH 1/7] fault-inject: make enum fault_flags available unconditionally Christoph Hellwig
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Christoph Hellwig @ 2025-11-11 13:52 UTC (permalink / raw)
  To: Vlastimil Babka, Andrew Morton
  Cc: Christoph Lameter, David Rientjes, Roman Gushchin, Harry Yoo,
	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 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      |    7 
 mm/mempool.c                 |  341 ++++++++++++++++++++++++++++---------------
 3 files changed, 240 insertions(+), 116 deletions(-)


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

end of thread, other threads:[~2025-11-13  5:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 13:52 mempool_alloc_bulk and various mempool improvements Christoph Hellwig
2025-11-11 13:52 ` [PATCH 1/7] fault-inject: make enum fault_flags available unconditionally Christoph Hellwig
2025-11-11 13:52 ` [PATCH 2/7] mempool: update kerneldoc comments Christoph Hellwig
2025-11-11 13:52 ` [PATCH 3/7] mempool: add error injection support Christoph Hellwig
2025-11-11 13:52 ` [PATCH 4/7] mempool: factor out a mempool_adjust_gfp helper Christoph Hellwig
2025-11-11 13:52 ` [PATCH 5/7] mempool: factor out a mempool_alloc_from_pool helper Christoph Hellwig
2025-11-11 13:52 ` [PATCH 6/7] mempool: fix a wakeup race when sleeping for elements Christoph Hellwig
2025-11-12 10:53   ` Vlastimil Babka
2025-11-12 15:38     ` Christoph Hellwig
2025-11-11 13:52 ` [PATCH 7/7] mempool: add mempool_{alloc,free}_bulk Christoph Hellwig
2025-11-12 12:20   ` Vlastimil Babka
2025-11-12 15:47     ` Christoph Hellwig
2025-11-12 15:56       ` Vlastimil Babka
2025-11-12 15:58         ` Christoph Hellwig
2025-11-12 12:22 ` mempool_alloc_bulk and various mempool improvements Vlastimil Babka
2025-11-12 15:50   ` Christoph Hellwig
2025-11-12 15:57     ` Vlastimil Babka
2025-11-12 17:34     ` Eric Biggers
2025-11-13  5:52       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).