1. 27 Sep, 2018 5 commits
    • Omar Sandoval's avatar
      kyber: add tracepoints · 6c3b7af1
      Omar Sandoval authored
      When debugging Kyber, it's really useful to know what latencies we've
      been having, how the domain depths have been adjusted, and if we've
      actually been throttling. Add three tracepoints, kyber_latency,
      kyber_adjust, and kyber_throttled, to record that.
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6c3b7af1
    • Omar Sandoval's avatar
      kyber: implement improved heuristics · 6e25cb01
      Omar Sandoval authored
      Kyber's current heuristics have a few flaws:
      
      - It's based on the mean latency, but p99 latency tends to be more
        meaningful to anyone who cares about latency. The mean can also be
        skewed by rare outliers that the scheduler can't do anything about.
      - The statistics calculations are purely time-based with a short window.
        This works for steady, high load, but is more sensitive to outliers
        with bursty workloads.
      - It only considers the latency once an I/O has been submitted to the
        device, but the user cares about the time spent in the kernel, as
        well.
      
      These are shortcomings of the generic blk-stat code which doesn't quite
      fit the ideal use case for Kyber. So, this replaces the statistics with
      a histogram used to calculate percentiles of total latency and I/O
      latency, which we then use to adjust depths in a slightly more
      intelligent manner:
      
      - Sync and async writes are now the same domain.
      - Discards are a separate domain.
      - Domain queue depths are scaled by the ratio of the p99 total latency
        to the target latency (e.g., if the p99 latency is double the target
        latency, we will double the queue depth; if the p99 latency is half of
        the target latency, we can halve the queue depth).
      - We use the I/O latency to determine whether we should scale queue
        depths down: we will only scale down if any domain's I/O latency
        exceeds the target latency, which is an indicator of congestion in the
        device.
      
      These new heuristics are just as scalable as the heuristics they
      replace.
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6e25cb01
    • Omar Sandoval's avatar
      kyber: don't make domain token sbitmap larger than necessary · fa2a1f60
      Omar Sandoval authored
      The domain token sbitmaps are currently initialized to the device queue
      depth or 256, whichever is larger, and immediately resized to the
      maximum depth for that domain (256, 128, or 64 for read, write, and
      other, respectively). The sbitmap is never resized larger than that, so
      it's unnecessary to allocate a bitmap larger than the maximum depth.
      Let's just allocate it to the maximum depth to begin with. This will use
      marginally less memory, and more importantly, give us a more appropriate
      number of bits per sbitmap word.
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      fa2a1f60
    • Omar Sandoval's avatar
      block: export blk_stat_enable_accounting() · f8232f29
      Omar Sandoval authored
      Kyber will need this in a future change if it is built as a module.
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f8232f29
    • Omar Sandoval's avatar
      block: move call of scheduler's ->completed_request() hook · ed88660a
      Omar Sandoval authored
      Commit 4bc6339a ("block: move blk_stat_add() to
      __blk_mq_end_request()") consolidated some calls using ktime_get() so
      we'd only need to call it once. Kyber's ->completed_request() hook also
      calls ktime_get(), so let's move it to the same place, too.
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ed88660a
  2. 26 Sep, 2018 13 commits
  3. 24 Sep, 2018 9 commits
  4. 22 Sep, 2018 13 commits