Tejun Heo 62a584fe05 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: Tejun Heo <tj@kernel.org>
Reported-by: Miao Xie <miaoxie@huawei.com>
Link: http://lkml.kernel.org/g/57333E75.3080309@huawei.com
Cc: stable@vger.kernel.org # v4.2+
Fixes: 9fc3a43e1757 ("writeback: separate out domain_dirty_limits()")
Reviewed-by: Jan Kara <jack@suse.cz>

Adjusted comment based on Jan's suggestion.
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-05-30 08:54:40 -06:00
..
2016-05-26 20:00:28 -07:00
2015-06-24 17:49:45 -07:00
2016-05-23 11:18:01 -07:00
2016-05-23 11:18:01 -07:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2016-05-26 20:00:28 -07:00
2015-09-08 15:35:28 -07:00
2016-05-27 15:57:31 -07:00
2016-03-17 15:09:34 -07:00
2015-11-05 19:34:48 -08:00
2016-05-27 15:57:31 -07:00
2016-03-17 15:09:34 -07:00
2016-05-19 15:20:54 -06:00
2016-05-23 17:04:14 -07:00
2016-05-20 17:58:30 -07:00