<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/block, branch v4.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2017-04-20T20:53:28Z</updated>
<entry>
<title>blk-mq: fix potential oops with polling and blk-mq scheduler</title>
<updated>2017-04-20T20:53:28Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2017-04-20T20:53:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a07bb1d7676ea24bc1585ba2a80604852c005e7'/>
<id>urn:sha1:3a07bb1d7676ea24bc1585ba2a80604852c005e7</id>
<content type='text'>
If we have a scheduler attached, blk_mq_tag_to_rq() on the
scheduled tags will return NULL if a request is no longer
in flight. This is different than using the normal tags,
where it will always return the fixed request. Check for
this condition for polling, in case we happen to enter
polling for a completed request.

The request address remains valid, so this check and return
should be perfectly safe.

Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers")
Tested-by: Stephen Bates &lt;sbates@raithlin.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: respect BLK_MQ_F_NO_SCHED</title>
<updated>2017-04-19T20:15:43Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2017-04-15T12:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a5088c8c11ac9d56f7e90acaaae9e0e98c1ff94'/>
<id>urn:sha1:3a5088c8c11ac9d56f7e90acaaae9e0e98c1ff94</id>
<content type='text'>
If one driver claims that it doesn't support io scheduler via
BLK_MQ_F_NO_SCHED, we should not allow to change and show the
availabe io schedulers.

This patch adds check to enhance this behaviour.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq: Restart a single queue if tag sets are shared</title>
<updated>2017-04-07T18:40:09Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2017-04-07T18:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d8c6c0f97ad8a3517c42b179c1dc8e77397d0e2'/>
<id>urn:sha1:6d8c6c0f97ad8a3517c42b179c1dc8e77397d0e2</id>
<content type='text'>
To improve scalability, if hardware queues are shared, restart
a single hardware queue in round-robin fashion. Rename
blk_mq_sched_restart_queues() to reflect the new semantics.
Remove blk_mq_sched_mark_restart_queue() because this function
has no callers. Remove flag QUEUE_FLAG_RESTART because this
patch removes the code that uses this flag.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq: Introduce blk_mq_delay_run_hw_queue()</title>
<updated>2017-04-07T18:27:06Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2017-04-07T18:16:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7587a5ae7eef0439f7be31f1b5959af062bbc5ec'/>
<id>urn:sha1:7587a5ae7eef0439f7be31f1b5959af062bbc5ec</id>
<content type='text'>
Introduce a function that runs a hardware queue unconditionally
after a delay. Note: there is already a function that stops and
restarts a hardware queue after a delay, namely blk_mq_delay_queue().

This function will be used in the next patch in this series.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: Long Li &lt;longli@microsoft.com&gt;
Cc: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq: remap queues when adding/removing hardware queues</title>
<updated>2017-04-07T14:56:49Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-04-07T14:53:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ebe8bddb6e30d7a02775b9972099271fc5910f37'/>
<id>urn:sha1:ebe8bddb6e30d7a02775b9972099271fc5910f37</id>
<content type='text'>
blk_mq_update_nr_hw_queues() used to remap hardware queues, which is the
behavior that drivers expect. However, commit 4e68a011428a changed
blk_mq_queue_reinit() to not remap queues for the case of CPU
hotplugging, inadvertently making blk_mq_update_nr_hw_queues() not remap
queues as well. This breaks, for example, NBD's multi-connection mode,
leaving the added hardware queues unused. Fix it by making
blk_mq_update_nr_hw_queues() explicitly remap the queues.

Fixes: 4e68a011428a ("blk-mq: don't redistribute hardware queues on a CPU hotplug event")
Reviewed-by: Keith Busch &lt;keith.busch@intel.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq-sched: fix crash in switch error path</title>
<updated>2017-04-07T14:56:48Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-04-07T14:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54d5329d425650fafaf90660a139c771d2d49cae'/>
<id>urn:sha1:54d5329d425650fafaf90660a139c771d2d49cae</id>
<content type='text'>
In elevator_switch(), if blk_mq_init_sched() fails, we attempt to fall
back to the original scheduler. However, at this point, we've already
torn down the original scheduler's tags, so this causes a crash. Doing
the fallback like the legacy elevator path is much harder for mq, so fix
it by just falling back to none, instead.

Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq-sched: set up scheduler tags when bringing up new queues</title>
<updated>2017-04-07T14:56:46Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-04-05T19:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93252632e828da3e90241a1c0e766556abf71598'/>
<id>urn:sha1:93252632e828da3e90241a1c0e766556abf71598</id>
<content type='text'>
If a new hardware queue is added at runtime, we don't allocate scheduler
tags for it, leading to a crash. This hooks up the scheduler framework
to blk_mq_{init,exit}_hctx() to make sure everything gets properly
initialized/freed.

Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq-sched: refactor scheduler initialization</title>
<updated>2017-04-07T14:56:44Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-04-05T19:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6917ff0b5bd4139e08a3f3146529dcb3b95ba7a6'/>
<id>urn:sha1:6917ff0b5bd4139e08a3f3146529dcb3b95ba7a6</id>
<content type='text'>
Preparation cleanup for the next couple of fixes, push
blk_mq_sched_setup() and e-&gt;ops.mq.init_sched() into a helper.

Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq: use the right hctx when getting a driver tag fails</title>
<updated>2017-04-07T14:56:26Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-04-07T14:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81380ca10778b99dce98940cfc993214712df335'/>
<id>urn:sha1:81380ca10778b99dce98940cfc993214712df335</id>
<content type='text'>
While dispatching requests, if we fail to get a driver tag, we mark the
hardware queue as waiting for a tag and put the requests on a
hctx-&gt;dispatch list to be run later when a driver tag is freed. However,
blk_mq_dispatch_rq_list() may dispatch requests from multiple hardware
queues if using a single-queue scheduler with a multiqueue device. If
blk_mq_get_driver_tag() fails, it doesn't update the hardware queue we
are processing. This means we end up using the hardware queue of the
previous request, which may or may not be the same as that of the
current request. If it isn't, the wrong hardware queue will end up
waiting for a tag, and the requests will be on the wrong dispatch list,
leading to a hang.

The fix is twofold:

1. Make sure we save which hardware queue we were trying to get a
   request for in blk_mq_get_driver_tag() regardless of whether it
   succeeds or not.
2. Make blk_mq_dispatch_rq_list() take a request_queue instead of a
   blk_mq_hw_queue to make it clear that it must handle multiple
   hardware queues, since I've already messed this up on a couple of
   occasions.

This didn't appear in testing with nvme and mq-deadline because nvme has
more driver tags than the default number of scheduler tags. However,
with the blk_mq_update_nr_hw_queues() fix, it showed up with nbd.

Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: do not put mq context in blk_mq_alloc_request_hctx</title>
<updated>2017-03-30T14:13:23Z</updated>
<author>
<name>Minchan Kim</name>
<email>minchan@kernel.org</email>
</author>
<published>2017-03-30T05:20:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac77a0c463c1d7d659861f7b6d1261970dd3282a'/>
<id>urn:sha1:ac77a0c463c1d7d659861f7b6d1261970dd3282a</id>
<content type='text'>
In blk_mq_alloc_request_hctx, blk_mq_sched_get_request doesn't
get sw context so we don't need to put the context with
blk_mq_put_ctx. Unless, we will see preempt counter underflow.

Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Signed-off-by: Minchan Kim &lt;minchan@kernel.org&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
</feed>
