From: Jens Axboe Date: Fri, 7 Apr 2017 18:45:20 +0000 (-0600) Subject: Merge branch 'for-linus' into for-4.12/block X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=65f619d2535197d97067eeeef75a40f25b552e69;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'for-linus' into for-4.12/block We've added a considerable amount of fixes for stalls and issues with the blk-mq scheduling in the 4.11 series since forking off the for-4.12/block branch. We need to do improvements on top of that for 4.12, so pull in the previous fixes to make our lives easier going forward. Signed-off-by: Jens Axboe --- 65f619d2535197d97067eeeef75a40f25b552e69 diff --cc block/blk-mq.c index f7cd3208bcdf,572966f49596..724bcec0ca4f --- a/block/blk-mq.c +++ b/block/blk-mq.c @@@ -980,12 -960,23 +978,15 @@@ static bool blk_mq_dispatch_wait_add(st return true; } - bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list) + bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list) { - struct request_queue *q = hctx->queue; + struct blk_mq_hw_ctx *hctx; struct request *rq; - LIST_HEAD(driver_list); - struct list_head *dptr; int errors, queued, ret = BLK_MQ_RQ_QUEUE_OK; + if (list_empty(list)) + return false; + - /* - * Start off with dptr being NULL, so we start the first request - * immediately, even if we have more pending. - */ - dptr = NULL; - /* * Now process all the entries, sending them to the driver. */ @@@ -1053,7 -1045,14 +1054,7 @@@ if (ret == BLK_MQ_RQ_QUEUE_BUSY) break; - } - - /* - * We've done the first request. If we have more than 1 - * left in the list, set dptr to defer issue. - */ - if (!dptr && list->next != list->prev) - dptr = &driver_list; + } while (!list_empty(list)); hctx->dispatched[queued_to_index(queued)]++; @@@ -2610,8 -2752,19 +2649,9 @@@ void blk_mq_update_nr_hw_queues(struct blk_mq_freeze_queue(q); set->nr_hw_queues = nr_hw_queues; + blk_mq_update_queue_map(set); list_for_each_entry(q, &set->tag_list, tag_set_list) { blk_mq_realloc_hw_ctxs(set, q); - - /* - * Manually set the make_request_fn as blk_queue_make_request - * resets a lot of the queue settings. - */ - if (q->nr_hw_queues > 1) - q->make_request_fn = blk_mq_make_request; - else - q->make_request_fn = blk_sq_make_request; - blk_mq_queue_reinit(q, cpu_online_mask); } diff --cc block/blk-sysfs.c index 45854266e398,37f0b3ad635e..c47db43a40cc --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@@ -803,11 -816,9 +803,11 @@@ static void blk_release_queue(struct ko if (q->elevator) { ioc_clear_queue(q); - elevator_exit(q->elevator); + elevator_exit(q, q->elevator); } + blk_free_queue_stats(q->stats); + blk_exit_rl(&q->root_rl); if (q->queue_tags) diff --cc include/linux/blkdev.h index 3cf241b0814d,7548f332121a..d76bebbc632e --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@@ -615,9 -610,6 +615,8 @@@ struct request_queue #define QUEUE_FLAG_FLUSH_NQ 25 /* flush not queueuable */ #define QUEUE_FLAG_DAX 26 /* device supports DAX */ #define QUEUE_FLAG_STATS 27 /* track rq completion times */ - #define QUEUE_FLAG_RESTART 28 /* queue needs restart at completion */ - #define QUEUE_FLAG_POLL_STATS 29 /* collecting stats for hybrid polling */ - #define QUEUE_FLAG_REGISTERED 30 /* queue has been registered to a disk */ ++#define QUEUE_FLAG_POLL_STATS 28 /* collecting stats for hybrid polling */ ++#define QUEUE_FLAG_REGISTERED 29 /* queue has been registered to a disk */ #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ (1 << QUEUE_FLAG_STACKABLE) | \