All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: set make_request_fn manually in blk_mq_update_nr_hw_queues
@ 2017-02-10 18:03 Josef Bacik
  2017-02-10 18:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2017-02-10 18:03 UTC (permalink / raw)
  To: axboe, linux-block, kernel-team

Calling blk_queue_make_request resets a bunch of settings on the
request_queue, but all we really want is to update the make_request_fn,
so do this directly so we don't lose things like the logical and
physical block sizes.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 block/blk-mq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index be183e61..eccbb13 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2627,10 +2627,14 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
 	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)
-			blk_queue_make_request(q, blk_mq_make_request);
+			q->make_request_fn = blk_mq_make_request;
 		else
-			blk_queue_make_request(q, blk_sq_make_request);
+			q->make_request_fn = blk_sq_make_request;
 
 		blk_mq_queue_reinit(q, cpu_online_mask);
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: set make_request_fn manually in blk_mq_update_nr_hw_queues
  2017-02-10 18:03 [PATCH] block: set make_request_fn manually in blk_mq_update_nr_hw_queues Josef Bacik
@ 2017-02-10 18:15 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-02-10 18:15 UTC (permalink / raw)
  To: Josef Bacik, axboe, linux-block, kernel-team

On 02/10/2017 11:03 AM, Josef Bacik wrote:
> Calling blk_queue_make_request resets a bunch of settings on the
> request_queue, but all we really want is to update the make_request_fn,
> so do this directly so we don't lose things like the logical and
> physical block sizes.

Applied, thanks Josef.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-10 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 18:03 [PATCH] block: set make_request_fn manually in blk_mq_update_nr_hw_queues Josef Bacik
2017-02-10 18:15 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.