1. 10 5月, 2020 1 次提交
  2. 05 5月, 2020 1 次提交
    • T
      iocost: protect iocg->abs_vdebt with iocg->waitq.lock · 0b80f986
      Tejun Heo 提交于
      abs_vdebt is an atomic_64 which tracks how much over budget a given cgroup
      is and controls the activation of use_delay mechanism. Once a cgroup goes
      over budget from forced IOs, it has to pay it back with its future budget.
      The progress guarantee on debt paying comes from the iocg being active -
      active iocgs are processed by the periodic timer, which ensures that as time
      passes the debts dissipate and the iocg returns to normal operation.
      
      However, both iocg activation and vdebt handling are asynchronous and a
      sequence like the following may happen.
      
      1. The iocg is in the process of being deactivated by the periodic timer.
      
      2. A bio enters ioc_rqos_throttle(), calls iocg_activate() which returns
         without anything because it still sees that the iocg is already active.
      
      3. The iocg is deactivated.
      
      4. The bio from #2 is over budget but needs to be forced. It increases
         abs_vdebt and goes over the threshold and enables use_delay.
      
      5. IO control is enabled for the iocg's subtree and now IOs are attributed
         to the descendant cgroups and the iocg itself no longer issues IOs.
      
      This leaves the iocg with stuck abs_vdebt - it has debt but inactive and no
      further IOs which can activate it. This can end up unduly punishing all the
      descendants cgroups.
      
      The usual throttling path has the same issue - the iocg must be active while
      throttled to ensure that future event will wake it up - and solves the
      problem by synchronizing the throttling path with a spinlock. abs_vdebt
      handling is another form of overage handling and shares a lot of
      characteristics including the fact that it isn't in the hottest path.
      
      This patch fixes the above and other possible races by strictly
      synchronizing abs_vdebt and use_delay handling with iocg->waitq.lock.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NVlad Dmitriev <vvd@fb.com>
      Cc: stable@vger.kernel.org # v5.4+
      Fixes: e1518f63 ("blk-iocost: Don't let merges push vtime into the future")
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      0b80f986
  3. 01 5月, 2020 1 次提交
  4. 21 4月, 2020 1 次提交
    • W
      blk-iocost: Fix error on iocost_ioc_vrate_adj · d6c8e949
      Waiman Long 提交于
      Systemtap 4.2 is unable to correctly interpret the "u32 (*missed_ppm)[2]"
      argument of the iocost_ioc_vrate_adj trace entry defined in
      include/trace/events/iocost.h leading to the following error:
      
        /tmp/stapAcz0G0/stap_c89c58b83cea1724e26395efa9ed4939_6321_aux_6.c:78:8:
        error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
         , u32[]* __tracepoint_arg_missed_ppm
      
      That argument type is indeed rather complex and hard to read. Looking
      at block/blk-iocost.c. It is just a 2-entry u32 array. By simplifying
      the argument to a simple "u32 *missed_ppm" and adjusting the trace
      entry accordingly, the compilation error was gone.
      
      Fixes: 7caa4715 ("blkcg: implement blk-iocost")
      Acked-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NWaiman Long <longman@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d6c8e949
  5. 17 4月, 2020 1 次提交
  6. 16 4月, 2020 1 次提交
  7. 10 4月, 2020 1 次提交
  8. 08 4月, 2020 1 次提交
  9. 07 4月, 2020 1 次提交
  10. 02 4月, 2020 2 次提交
    • T
      blkcg: don't offline parent blkcg first · 4308a434
      Tejun Heo 提交于
      blkcg->cgwb_refcnt is used to delay blkcg offlining so that blkgs
      don't get offlined while there are active cgwbs on them.  However, it
      ends up making offlining unordered sometimes causing parents to be
      offlined before children.
      
      Let's fix this by making child blkcgs pin the parents' online states.
      
      Note that pin/unpin names are chosen over get/put intentionally
      because css uses get/put online for something different.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4308a434
    • T
      blkcg: rename blkcg->cgwb_refcnt to ->online_pin and always use it · d866dbf6
      Tejun Heo 提交于
      blkcg->cgwb_refcnt is used to delay blkcg offlining so that blkgs
      don't get offlined while there are active cgwbs on them.  However, it
      ends up making offlining unordered sometimes causing parents to be
      offlined before children.
      
      To fix it, we want child blkcgs to pin the parents' online states
      turning the refcnt into a more generic online pinning mechanism.
      
      In prepartion,
      
      * blkcg->cgwb_refcnt -> blkcg->online_pin
      * blkcg_cgwb_get/put() -> blkcg_pin/unpin_online()
      * Take them out of CONFIG_CGROUP_WRITEBACK
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d866dbf6
  11. 30 3月, 2020 1 次提交
  12. 28 3月, 2020 5 次提交
  13. 27 3月, 2020 1 次提交
  14. 25 3月, 2020 12 次提交
  15. 24 3月, 2020 10 次提交