]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/blk-mq.c
blk-mq: fix plugging in blk_sq_make_request
authorJeff Moyer <jmoyer@redhat.com>
Fri, 8 May 2015 17:51:30 +0000 (10:51 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 8 May 2015 20:17:17 +0000 (14:17 -0600)
commite6c4438ba7cb615448492849970aaf0aaa1cc973
treebf7e99da1027c03a29552b19873dec52de0b8050
parent5596d0d591bea25424c07f0fce00df5af593b31f
blk-mq: fix plugging in blk_sq_make_request

The following appears in blk_sq_make_request:

/*
 * If we have multiple hardware queues, just go directly to
 * one of those for sync IO.
 */

We clearly don't have multiple hardware queues, here!  This comment was
introduced with this commit 07068d5b8e (blk-mq: split make request
handler for multi and single queue):

    We want slightly different behavior from them:

    - On single queue devices, we currently use the per-process plug
      for deferred IO and for merging.

    - On multi queue devices, we don't use the per-process plug, but
      we want to go straight to hardware for SYNC IO.

The old code had this:

        use_plug = !is_flush_fua && ((q->nr_hw_queues == 1) || !is_sync);

and that was converted to:

use_plug = !is_flush_fua && !is_sync;

which is not equivalent.  For the single queue case, that second half of
the && expression is always true.  So, what I think was actually inteded
follows (and this more closely matches what is done in blk_queue_bio).

V2: delete the 'likely', which should not be a big deal

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c