From efbf1b6c6926b950699d4fecc237a37bbf819f38 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Sun, 3 May 2026 00:17:33 +0000 Subject: [PATCH] block: restore mempool reserves for non-block Commit b520c4eef83d ("block: split bio_alloc_bioset more clearly into a fast and slowpath") prevents non-blocking allocations from falling back to mempool_alloc() after the initial slab allocation has failed. This was based on the assumption that mempool_alloc() would simply retry the slab and fail again (for non-block). However, mempool_alloc() also attempts to dip into the pool reserves, even for non-blocking requests, and this option is no longer available after adding the early fail. This was noticed through the SCSI generic module which calls blk_rq_map_user_io() with GFP_ATOMIC. Remove the check to allow mempool reserves to be used for non-blocking requests, restoring the previous behavior. Fixes: b520c4eef83d ("block: split bio_alloc_bioset more clearly into a fast and slowpath") Signed-off-by: Carlos Llamas --- block/bio.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/block/bio.c b/block/bio.c index b8972dba68a0..e8f4934593b3 100644 --- a/block/bio.c +++ b/block/bio.c @@ -576,13 +576,6 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs, } if (unlikely(!bio)) { - /* - * Give up if we are not allow to sleep as non-blocking mempool - * allocations just go back to the slab allocation. - */ - if (!(saved_gfp & __GFP_DIRECT_RECLAIM)) - return NULL; - punt_bios_to_rescuer(bs); /*