]> git.baikalelectronics.ru Git - kernel.git/commit
blk-iocost: halve debts if device stays idle
authorTejun Heo <tj@kernel.org>
Tue, 1 Sep 2020 18:52:53 +0000 (14:52 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Sep 2020 01:38:33 +0000 (19:38 -0600)
commitd6c69a0fa1bf50b0ab43e10e389736974b8923ff
tree1a2daee0dfdc2dbfc4b9c592a052f7422dd74959
parent7d00abdb2a343488a704d9a95a622b402166a715
blk-iocost: halve debts if device stays idle

A low weight iocg can amass a large amount of debt, for example, when
anonymous memory gets reclaimed aggressively. If the system has a lot of
memory paired with a slow IO device, the debt can span multiple seconds or
more. If there are no other subsequent IO issuers, the in-debt iocg may end
up blocked paying its debt while the IO device is idle.

This patch implements a mechanism to protect against such pathological
cases. If the device has been sufficiently idle for a substantial amount of
time, the debts are halved. The criteria are on the conservative side as we
want to resolve the rare extreme cases without impacting regular operation
by forgiving debts too readily.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c