1. 25 1月, 2018 1 次提交
    • E
      blk-mq-debugfs: don't allow write on attributes with seq_operations set · 6b136a24
      Eryu Guan 提交于
      Attributes that only implement .seq_ops are read-only, any write to
      them should be rejected. But currently kernel would crash when
      writing to such debugfs entries, e.g.
      
      chmod +w /sys/kernel/debug/block/<dev>/requeue_list
      echo 0 > /sys/kernel/debug/block/<dev>/requeue_list
      chmod -w /sys/kernel/debug/block/<dev>/requeue_list
      
      Fix it by returning -EPERM in blk_mq_debugfs_write() when writing to
      such attributes.
      
      Cc: Ming Lei <ming.lei@redhat.com>
      Signed-off-by: NEryu Guan <eguan@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6b136a24
  2. 13 1月, 2018 1 次提交
    • J
      blk-mq: add missing RQF_STARTED to debugfs · 85ba3eff
      Jens Axboe 提交于
      Looking at debug output, we see:
      
      ./000000009ddfa913/requeue_list:000000009646711c {.op=READ, .state=idle, gen=0x1
      18, abort_gen=0x0, .cmd_flags=, .rq_flags=SORTED|1|SOFTBARRIER|IO_STAT, complete
      =0, .tag=-1, .internal_tag=217}
      
      Note the '1' between SORTED and SOFTBARRIER - that's because no name
      as defined for RQF_STARTED. Fixed that.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      85ba3eff
  3. 11 1月, 2018 3 次提交
  4. 10 1月, 2018 1 次提交
    • T
      blk-mq: remove REQ_ATOM_STARTED · 5a61c363
      Tejun Heo 提交于
      After the recent updates to use generation number and state based
      synchronization, we can easily replace REQ_ATOM_STARTED usages by
      adding an extra state to distinguish completed but not yet freed
      state.
      
      Add MQ_RQ_COMPLETE and replace REQ_ATOM_STARTED usages with
      blk_mq_rq_state() tests.  REQ_ATOM_STARTED no longer has any users
      left and is removed.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      5a61c363
  5. 11 11月, 2017 2 次提交
  6. 06 10月, 2017 1 次提交
  7. 04 10月, 2017 1 次提交
  8. 25 8月, 2017 1 次提交
  9. 18 8月, 2017 1 次提交
  10. 10 8月, 2017 1 次提交
  11. 28 6月, 2017 1 次提交
  12. 02 6月, 2017 4 次提交
  13. 04 5月, 2017 12 次提交
  14. 27 4月, 2017 6 次提交
  15. 21 4月, 2017 1 次提交
  16. 11 4月, 2017 2 次提交
  17. 22 3月, 2017 1 次提交
    • O
      blk-stat: convert to callback-based statistics reporting · 34dbad5d
      Omar Sandoval 提交于
      Currently, statistics are gathered in ~0.13s windows, and users grab the
      statistics whenever they need them. This is not ideal for both in-tree
      users:
      
      1. Writeback throttling wants its own dynamically sized window of
         statistics. Since the blk-stats statistics are reset after every
         window and the wbt windows don't line up with the blk-stats windows,
         wbt doesn't see every I/O.
      2. Polling currently grabs the statistics on every I/O. Again, depending
         on how the window lines up, we may miss some I/Os. It's also
         unnecessary overhead to get the statistics on every I/O; the hybrid
         polling heuristic would be just as happy with the statistics from the
         previous full window.
      
      This reworks the blk-stats infrastructure to be callback-based: users
      register a callback that they want called at a given time with all of
      the statistics from the window during which the callback was active.
      Users can dynamically bucketize the statistics. wbt and polling both
      currently use read vs. write, but polling can be extended to further
      subdivide based on request size.
      
      The callbacks are kept on an RCU list, and each callback has percpu
      stats buffers. There will only be a few users, so the overhead on the
      I/O completion side is low. The stats flushing is also simplified
      considerably: since the timer function is responsible for clearing the
      statistics, we don't have to worry about stale statistics.
      
      wbt is a trivial conversion. After the conversion, the windowing problem
      mentioned above is fixed.
      
      For polling, we register an extra callback that caches the previous
      window's statistics in the struct request_queue for the hybrid polling
      heuristic to use.
      
      Since we no longer have a single stats buffer for the request queue,
      this also removes the sysfs and debugfs stats entries. To replace those,
      we add a debugfs entry for the poll statistics.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      34dbad5d