Skip to content
  • Jeff Moyer's avatar
    blk-mq: fix plugging in blk_sq_make_request · e6c4438b
    Jeff Moyer authored
    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 07068d5b
    
     (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: default avatarJeff Moyer <jmoyer@redhat.com>
    Signed-off-by: default avatarShaohua Li <shli@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    e6c4438b