1. 27 Jan, 2021 3 commits
    • Jan Kara's avatar
      bfq: Use only idle IO periods for think time calculations · 7684fbde
      Jan Kara authored
      Currently whenever bfq queue has a request queued we add now -
      last_completion_time to the think time statistics. This is however
      misleading in case the process is able to submit several requests in
      parallel because e.g. if the queue has request completed at time T0 and
      then queues new requests at times T1, T2, then we will add T1-T0 and
      T2-T0 to think time statistics which just doesn't make any sence (the
      queue's think time is penalized by the queue being able to submit more
      IO). So add to think time statistics only time intervals when the queue
      had no IO pending.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      [axboe: fix whitespace on empty line]
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      7684fbde
    • Jan Kara's avatar
      bfq: Use 'ttime' local variable · 28c6def0
      Jan Kara authored
      Use local variable 'ttime' instead of dereferencing bfqq.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      28c6def0
    • Jan Kara's avatar
      bfq: Avoid false bfq queue merging · 41e76c85
      Jan Kara authored
      bfq_setup_cooperator() uses bfqd->in_serv_last_pos so detect whether it
      makes sense to merge current bfq queue with the in-service queue.
      However if the in-service queue is freshly scheduled and didn't dispatch
      any requests yet, bfqd->in_serv_last_pos is stale and contains value
      from the previously scheduled bfq queue which can thus result in a bogus
      decision that the two queues should be merged. This bug can be observed
      for example with the following fio jobfile:
      
      [global]
      direct=0
      ioengine=sync
      invalidate=1
      size=1g
      rw=read
      
      [reader]
      numjobs=4
      directory=/mnt
      
      where the 4 processes will end up in the one shared bfq queue although
      they do IO to physically very distant files (for some reason I was able to
      observe this only with slice_idle=1ms setting).
      
      Fix the problem by invalidating bfqd->in_serv_last_pos when switching
      in-service queue.
      
      Fixes: 058fdecc ("block, bfq: fix in-service-queue check for queue merging")
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatarPaolo Valente <paolo.valente@linaro.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      41e76c85
  2. 26 Jan, 2021 8 commits
  3. 25 Jan, 2021 29 commits