All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: Bart.VanAssche@wdc.com, willy@infradead.org,
	linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 5/6] block: use GFP_NOIO instead of __GFP_DIRECT_RECLAIM
Date: Wed,  9 May 2018 09:54:07 +0200	[thread overview]
Message-ID: <20180509075408.16388-6-hch@lst.de> (raw)
In-Reply-To: <20180509075408.16388-1-hch@lst.de>

We just can't do I/O when doing block layer requests allocations,
so use GFP_NOIO instead of the even more limited __GFP_DIRECT_RECLAIM.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
---
 block/blk-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index cc56e56c2eff..168e43d6398d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1578,8 +1578,7 @@ static struct request *blk_old_get_request(struct request_queue *q,
 				unsigned int op, blk_mq_req_flags_t flags)
 {
 	struct request *rq;
-	gfp_t gfp_mask = flags & BLK_MQ_REQ_NOWAIT ? GFP_ATOMIC :
-			 __GFP_DIRECT_RECLAIM;
+	gfp_t gfp_mask = flags & BLK_MQ_REQ_NOWAIT ? GFP_ATOMIC : GFP_NOIO;
 	int ret = 0;
 
 	WARN_ON_ONCE(q->mq_ops);
@@ -2057,7 +2056,7 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio)
 	 * Returns with the queue unlocked.
 	 */
 	blk_queue_enter_live(q);
-	req = get_request(q, bio->bi_opf, bio, 0, __GFP_DIRECT_RECLAIM);
+	req = get_request(q, bio->bi_opf, bio, 0, GFP_NOIO);
 	if (IS_ERR(req)) {
 		blk_queue_exit(q);
 		__wbt_done(q->rq_wb, wb_acct);
-- 
2.17.0

  parent reply	other threads:[~2018-05-09  7:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09  7:54 fix confusion around GFP_* flags and blk_get_request Christoph Hellwig
2018-05-09  7:54 ` [PATCH 1/6] scsi/osd: remove the gfp argument to osd_start_request Christoph Hellwig
2018-05-14 15:14   ` Bart Van Assche
2018-05-14 15:14     ` Bart Van Assche
2018-05-09  7:54 ` [PATCH 2/6] block: fix __get_request documentation Christoph Hellwig
2018-05-14 15:22   ` Bart Van Assche
2018-05-14 15:22     ` Bart Van Assche
2018-05-09  7:54 ` [PATCH 3/6] block: sanitize blk_get_request calling conventions Christoph Hellwig
2018-05-14 15:26   ` Bart Van Assche
2018-05-14 15:26     ` Bart Van Assche
2018-05-09  7:54 ` [PATCH 4/6] block: pass an explicit gfp_t to get_request Christoph Hellwig
2018-05-14 15:28   ` Bart Van Assche
2018-05-14 15:28     ` Bart Van Assche
2018-05-09  7:54 ` Christoph Hellwig [this message]
2018-05-14 15:30   ` [PATCH 5/6] block: use GFP_NOIO instead of __GFP_DIRECT_RECLAIM Bart Van Assche
2018-05-14 15:30     ` Bart Van Assche
2018-05-09  7:54 ` [PATCH 6/6] block: consistently use GFP_NOIO instead of __GFP_NORECLAIM Christoph Hellwig
2018-05-14 15:35   ` Bart Van Assche
2018-05-14 15:35     ` Bart Van Assche
2018-05-14 14:38 ` fix confusion around GFP_* flags and blk_get_request Christoph Hellwig
2018-05-14 14:54   ` Jens Axboe

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=20180509075408.16388-6-hch@lst.de \
    --to=hch@lst.de \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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.