All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, tj@kernel.org,
	jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
Date: Wed, 24 Jan 2024 10:39:41 +0100	[thread overview]
Message-ID: <20240124093941.2259199-1-hch@lst.de> (raw)

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@lst.de>
---
 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


             reply	other threads:[~2024-01-24  9:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  9:39 Christoph Hellwig [this message]
2024-01-24 15:40 ` [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck Jens Axboe
2024-01-25  8:10   ` Christoph Hellwig
2024-01-25 16:09     ` Jens Axboe
2024-01-25 16:11       ` Matthew Wilcox
2024-01-25 16:13         ` Jens Axboe
2024-01-26 13:52           ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240124093941.2259199-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.