diff options
author | Sean Paul <seanpaul@chromium.org> | 2017-06-27 11:36:28 -0400 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2017-06-27 11:36:28 -0400 |
commit | c048c984de38d906bb0df56ec2ae90eafc123d0a (patch) | |
tree | 4e670e712aeedcaf2e2193b64f9120e03320e01c /block/blk-mq.c | |
parent | 38cb266ad1a24e037220dc563ab46364595b17b6 (diff) | |
parent | 6d61e70ccc21606ffb8a0a03bd3aba24f659502b (diff) |
Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next-fixesdrm-misc-next-fixes-2017-06-27
Backmerge drm-next with rc7
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index bb66c96850b1..958cedaff8b8 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2103,20 +2103,30 @@ static void blk_mq_map_swqueue(struct request_queue *q, } } +/* + * Caller needs to ensure that we're either frozen/quiesced, or that + * the queue isn't live yet. + */ static void queue_set_hctx_shared(struct request_queue *q, bool shared) { struct blk_mq_hw_ctx *hctx; int i; queue_for_each_hw_ctx(q, hctx, i) { - if (shared) + if (shared) { + if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) + atomic_inc(&q->shared_hctx_restart); hctx->flags |= BLK_MQ_F_TAG_SHARED; - else + } else { + if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) + atomic_dec(&q->shared_hctx_restart); hctx->flags &= ~BLK_MQ_F_TAG_SHARED; + } } } -static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set, bool shared) +static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set, + bool shared) { struct request_queue *q; |