From: Yafang Shao <laoar.shao@gmail.com>
To: akpm@linux-foundation.org
Cc: jack@suse.cz, mhocko@suse.com, linux-mm@kvack.org,
Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH] mm: print a warning once the vm dirtiness settings is illogical
Date: Thu, 28 Sep 2017 17:54:24 +0800 [thread overview]
Message-ID: <1506592464-30962-1-git-send-email-laoar.shao@gmail.com> (raw)
The vm direct limit setting must be set greater than vm background
limit setting.
Otherwise we will print a warning to help the operator to figure
out that the vm dirtiness settings is in illogical state.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
Documentation/sysctl/vm.txt | 7 +++++++
mm/page-writeback.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 9baf66a..30fd16b 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -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
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
@@ -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.
+Note: dirty_ratio must be set greater than dirty_background_ratio or
+ratio corresponding to dirty_background_bytes.
+
==============================================================
dirty_writeback_centisecs
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0b9c5cb..8b747dd 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -433,8 +433,11 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc)
else
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;
+ }
+
tsk = current;
if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) {
bg_thresh += bg_thresh / 4 + global_wb_domain.dirty_limit / 32;
--
1.8.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2017-09-28 2:08 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 9:54 Yafang Shao [this message]
2017-11-25 16:05 ` [PATCH] mm: print a warning once the vm dirtiness settings is illogical Tetsuo Handa
2017-11-26 2:24 ` Yafang Shao
2017-11-26 2:42 ` Tetsuo Handa
2017-11-26 4:32 ` Yafang Shao
2017-11-26 8:03 ` Tetsuo Handa
2017-11-26 8:27 ` Yafang Shao
2017-11-26 8:46 ` Yafang Shao
2017-11-26 10:38 ` Tetsuo Handa
2017-11-27 8:06 ` Yafang Shao
2017-11-27 8:21 ` Michal Hocko
2017-11-27 8:29 ` Yafang Shao
2017-11-27 8:32 ` Yafang Shao
2017-11-27 8:37 ` Michal Hocko
2017-11-27 8:49 ` Yafang Shao
2017-11-27 8:52 ` Michal Hocko
2017-11-27 8:54 ` Yafang Shao
2017-11-27 9:04 ` Michal Hocko
2017-11-27 9:08 ` Yafang Shao
2017-11-27 8:34 ` Michal Hocko
2017-11-27 9:19 ` [PATCH] Revert "mm/page-writeback.c: print a warning if the vm dirtiness settings are illogical" (was: Re: [PATCH] mm: print a warning once the vm dirtiness settings is illogical) Michal Hocko
2017-11-28 3:11 ` Yafang Shao
2017-11-28 6:12 ` Yafang Shao
2017-11-28 7:45 ` Michal Hocko
2017-11-28 7:52 ` Yafang Shao
2017-11-28 9:43 ` Yafang Shao
2017-11-28 9:45 ` Michal Hocko
2017-11-28 10:09 ` Jan Kara
2017-11-28 10:16 ` Yafang Shao
2017-11-28 10:25 ` Jan Kara
2017-11-28 10:33 ` Yafang Shao
2017-11-28 10:41 ` Jan Kara
2017-11-28 10:44 ` Yafang Shao
2017-11-28 10:37 ` Jan Kara
2017-11-28 10:48 ` Michal Hocko
2017-11-28 11:05 ` Yafang Shao
2017-11-28 11:54 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506592464-30962-1-git-send-email-laoar.shao@gmail.com \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jack@suse.cz \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).