06 Oct, 2019

1 commit

  • scale_up wakes up waiters after scaling up. But after scaling max, it
    should not wake up more waiters as waiters will not have anything to
    do. This patch fixes this by making scale_up (and also scale_down)
    return when threshold is reached.

    This bug causes increased fdatasync latency when fdatasync and dd
    conv=sync are performed in parallel on 4.19 compared to 4.14. This
    bug was introduced during refactoring of blk-wbt code.

    Fixes: a79050434b45 ("blk-rq-qos: refactor out common elements of blk-wbt")
    Cc: stable@vger.kernel.org
    Cc: Josef Bacik
    Signed-off-by: Harshad Shirwadkar
    Signed-off-by: Jens Axboe

    Harshad Shirwadkar
     

29 Aug, 2019

2 commits


19 Jul, 2019

4 commits

  • Oleg noticed that our checking of data.got_token is unsafe in the
    cleanup case, and should really use a memory barrier. Use a wmb on the
    write side, and a rmb() on the read side. We don't need one in the main
    loop since we're saved by set_current_state().

    Reviewed-by: Oleg Nesterov
    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     
  • In case we get a spurious wakeup we need to make sure to re-set
    ourselves to TASK_UNINTERRUPTIBLE so we don't busy wait.

    Reviewed-by: Oleg Nesterov
    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     
  • If we raced with somebody else getting an inflight counter we could fail
    to get an inflight counter with no sleepers on the list, and thus need
    to go to sleep. In this case has_sleepers should be true because we are
    now relying on the waker to get our inflight counter for us. And in the
    case of spurious wakeups we'd still want this to be the case. So set
    has_sleepers to true if we went to sleep to make sure we're woken up the
    proper way.

    Reviewed-by: Oleg Nesterov
    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     
  • We saw a hang in production with WBT where there was only one waiter in
    the throttle path and no outstanding IO. This is because of the
    has_sleepers optimization that is used to make sure we don't steal an
    inflight counter for new submitters when there are people already on the
    list.

    We can race with our check to see if the waitqueue has any waiters (this
    is done locklessly) and the time we actually add ourselves to the
    waitqueue. If this happens we'll go to sleep and never be woken up
    because nobody is doing IO to wake us up.

    Fix this by checking if the waitqueue has a single sleeper on the list
    after we add ourselves, that way we have an uptodate view of the list.

    Reviewed-by: Oleg Nesterov
    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     

01 Jun, 2019

1 commit


01 May, 2019

1 commit


17 Dec, 2018

1 commit

  • blk-mq-debugfs has been proved as very helpful for debug some
    tough issues, such as IO hang.

    We have seen blk-wbt related IO hang several times, even inside
    Red Hat BZ, there is such report not sovled yet, so this patch
    adds support debugfs on rq_qos.

    Cc: Bart Van Assche
    Cc: Omar Sandoval
    Cc: Christoph Hellwig
    Cc: Josef Bacik
    Signed-off-by: Ming Lei
    Signed-off-by: Jens Axboe

    Ming Lei
     

08 Dec, 2018

1 commit

  • Originally when I split out the common code from blk-wbt into rq_qos I
    left the wbt_wait() where it was and simply copied and modified it
    slightly to work for io-latency. However they are both basically the
    same thing, and as time has gone on wbt_wait() has ended up much smarter
    and kinder than it was when I copied it into io-latency, which means
    io-latency has lost out on these improvements.

    Since they are the same thing essentially except for a few minor things,
    create rq_qos_wait() that replicates what wbt_wait() currently does with
    callbacks that can be passed in for the snowflakes to do their own thing
    as appropriate.

    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     

16 Nov, 2018

2 commits


23 Jul, 2018

1 commit


09 Jul, 2018

3 commits

  • wbt cares only about request completion time, but controllers may need
    information that is on the bio itself, so add a done_bio callback for
    rq-qos so things like blk-iolatency can use it to have the bio when it
    completes.

    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     
  • We don't really need to save this stuff in the core block code, we can
    just pass the bio back into the helpers later on to derive the same
    flags and update the rq->wbt_flags appropriately.

    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik
     
  • blkcg-qos is going to do essentially what wbt does, only on a cgroup
    basis. Break out the common code that will be shared between blkcg-qos
    and wbt into blk-rq-qos.* so they can both utilize the same
    infrastructure.

    Signed-off-by: Josef Bacik
    Signed-off-by: Jens Axboe

    Josef Bacik