Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 62a584fe authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

writeback: use higher precision calculation in domain_dirty_limits()



As vm.dirty_[background_]bytes can't be applied verbatim to multiple
cgroup writeback domains, they get converted to percentages in
domain_dirty_limits() and applied the same way as
vm.dirty_[background]ratio.  However, if the specified bytes is lower
than 1% of available memory, the calculated ratios become zero and the
writeback domain gets throttled constantly.

Fix it by using per-PAGE_SIZE instead of percentage for ratio
calculations.  Also, the updated DIV_ROUND_UP() usages now should
yield 1/4096 (0.0244%) as the minimum ratio as long as the specified
bytes are above zero.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarMiao Xie <miaoxie@huawei.com>
Link: http://lkml.kernel.org/g/57333E75.3080309@huawei.com


Cc: stable@vger.kernel.org # v4.2+
Fixes: 9fc3a43e ("writeback: separate out domain_dirty_limits()")
Reviewed-by: default avatarJan Kara <jack@suse.cz>

Adjusted comment based on Jan's suggestion.
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent b02b1fbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment