• Tejun Heo's avatar
    blk-iocost: switch to fixed non-auto-decaying use_delay · 54c52e10
    Tejun Heo authored
    The use_delay mechanism was introduced by blk-iolatency to hold memory
    allocators accountable for the reclaim and other shared IOs they cause. The
    duration of the delay is dynamically balanced between iolatency increasing the
    value on each target miss and it auto-decaying as time passes and threads get
    delayed on it.
    
    While this works well for iolatency, iocost's control model isn't compatible
    with it. There is no repeated "violation" events which can be balanced against
    auto-decaying. iocost instead knows how much a given cgroup is over budget and
    wants to prevent that cgroup from issuing IOs while over budget. Until now,
    iocost has been adding the cost of force-issued IOs. However, this doesn't
    reflect the amount which is already over budget and is simply not enough to
    counter the auto-decaying allowing anon-memory leaking low priority cgroup to
    go over its alloted share of IOs.
    
    As auto-decaying doesn't make much sense for iocost, this patch introduces a
    different mode of operation for use_delay - when blkcg_set_delay() are used
    insted of blkcg_add/use_delay(), the delay duration is not auto-decayed until it
    is explicitly cleared with blkcg_clear_delay(). iocost is updated to keep the
    delay duration synchronized to the budget overage amount.
    
    With this change, iocost can effectively police cgroups which generate
    significant amount of force-issued IOs.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Josef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    54c52e10
blk-iocost.c 66.9 KB