[PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure all in-line block layer submission runs in noio reclaim
context.  This is a big step towards allowing GFP_NOIO, the other
one would be to have noio (and nofs for that matter) workqueues for
kblockd and driver internal workqueues.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 block/blk-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index 11342af420d0c4..b85ef8a0fdf6a0 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -691,6 +691,8 @@ static void __submit_bio_noacct_mq(struct bio *bio)
 
 void submit_bio_noacct_nocheck(struct bio *bio)
 {
+	unsigned int noio_flag = memalloc_noio_save();
+
 	blk_cgroup_bio_start(bio);
 	blkcg_bio_issue_init(bio);
 
@@ -715,6 +717,8 @@ void submit_bio_noacct_nocheck(struct bio *bio)
 		__submit_bio_noacct_mq(bio);
 	else
 		__submit_bio_noacct(bio);
+
+	memalloc_noio_restore(noio_flag);
 }
 
 /**
-- 
2.39.2





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux