Commit 0f6d24f8 authored by Yafang Shao's avatar Yafang Shao Committed by Linus Torvalds

mm/page-writeback.c: print a warning if the vm dirtiness settings are illogical

The vm direct limit setting must be set greater than vm background limit
setting.  Otherwise print a warning to help the operator to figure out
that the vm dirtiness settings is in illogical state.

Link: http://lkml.kernel.org/r/1506592464-30962-1-git-send-email-laoar.shao@gmail.comSigned-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 66e8b438
...@@ -157,6 +157,10 @@ Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any ...@@ -157,6 +157,10 @@ Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
value lower than this limit will be ignored and the old configuration will be value lower than this limit will be ignored and the old configuration will be
retained. retained.
Note: the value of dirty_bytes also must be set greater than
dirty_background_bytes or the amount of memory corresponding to
dirty_background_ratio.
============================================================== ==============================================================
dirty_expire_centisecs dirty_expire_centisecs
...@@ -176,6 +180,9 @@ generating disk writes will itself start writing out dirty data. ...@@ -176,6 +180,9 @@ generating disk writes will itself start writing out dirty data.
The total available memory is not equal to total system memory. The total available memory is not equal to total system memory.
Note: dirty_ratio must be set greater than dirty_background_ratio or
ratio corresponding to dirty_background_bytes.
============================================================== ==============================================================
dirty_writeback_centisecs dirty_writeback_centisecs
......
...@@ -433,8 +433,11 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc) ...@@ -433,8 +433,11 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc)
else else
bg_thresh = (bg_ratio * available_memory) / PAGE_SIZE; bg_thresh = (bg_ratio * available_memory) / PAGE_SIZE;
if (bg_thresh >= thresh) if (unlikely(bg_thresh >= thresh)) {
pr_warn("vm direct limit must be set greater than background limit.\n");
bg_thresh = thresh / 2; bg_thresh = thresh / 2;
}
tsk = current; tsk = current;
if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) { if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) {
bg_thresh += bg_thresh / 4 + global_wb_domain.dirty_limit / 32; bg_thresh += bg_thresh / 4 + global_wb_domain.dirty_limit / 32;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment