block: enable polling by default if a poll map is initalized
authorChristoph Hellwig <hch@lst.de>
Sun, 2 Dec 2018 16:46:28 +0000 (17:46 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Dec 2018 18:38:19 +0000 (11:38 -0700)
If the user did setup polling in the driver we should not require
another know in the block layer to enable it.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c

index 50d529602e0589bf431ad90eea630f881d67e5f9..eabc7fcd96db1ca9ee2d303fd8efc03ec07a277a 100644 (file)
@@ -2826,6 +2826,8 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
        q->tag_set = set;
 
        q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT;
+       if (set->nr_maps > HCTX_TYPE_POLL)
+               blk_queue_flag_set(QUEUE_FLAG_POLL, q);
 
        if (!(set->flags & BLK_MQ_F_SG_MERGE))
                blk_queue_flag_set(QUEUE_FLAG_NO_SG_MERGE, q);