summaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
authorJianchao Wang <jianchao.w.wang@oracle.com>2018-10-12 18:07:26 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-01 08:26:10 +0200
commit313efb253d03d7b5dc3dee1d25098133fc8b12a5 (patch)
tree770e4b2a6b975f7834f4adf70995dbfc950abe46 /block/blk-flush.c
parent75448f40b9f6c0fd6d6afdf9101fbb2697fb5608 (diff)
downloadlinux-stable-313efb253d03d7b5dc3dee1d25098133fc8b12a5.tar.gz
linux-stable-313efb253d03d7b5dc3dee1d25098133fc8b12a5.tar.bz2
linux-stable-313efb253d03d7b5dc3dee1d25098133fc8b12a5.zip
blk-mq: change gfp flags to GFP_NOIO in blk_mq_realloc_hw_ctxs
[ Upstream commit 5b202853ffbc54b29f23c4b1b5f3948efab489a2 ] blk_mq_realloc_hw_ctxs could be invoked during update hw queues. At the momemt, IO is blocked. Change the gfp flags from GFP_KERNEL to GFP_NOIO to avoid forever hang during memory allocation in blk_mq_realloc_hw_ctxs. Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 76487948a27f..87fc49daa2b4 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -566,12 +566,12 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
EXPORT_SYMBOL(blkdev_issue_flush);
struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q,
- int node, int cmd_size)
+ int node, int cmd_size, gfp_t flags)
{
struct blk_flush_queue *fq;
int rq_sz = sizeof(struct request);
- fq = kzalloc_node(sizeof(*fq), GFP_KERNEL, node);
+ fq = kzalloc_node(sizeof(*fq), flags, node);
if (!fq)
goto fail;
@@ -579,7 +579,7 @@ struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q,
spin_lock_init(&fq->mq_flush_lock);
rq_sz = round_up(rq_sz + cmd_size, cache_line_size());
- fq->flush_rq = kzalloc_node(rq_sz, GFP_KERNEL, node);
+ fq->flush_rq = kzalloc_node(rq_sz, flags, node);
if (!fq->flush_rq)
goto fail_rq;