Skip to content

Commit

Permalink
block: use GFP_NOIO instead of __GFP_DIRECT_RECLAIM
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed May 14, 2018
1 parent 4accf5f commit c303602
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,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);
Expand Down Expand Up @@ -2056,7 +2055,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);
Expand Down

0 comments on commit c303602

Please sign in to comment.