Re: [PATCH v4] mm: introduce validity check on vm dirtiness settings
From: Yafang Shao <hidden>
Date: 2017-09-27 01:38:23
2017-09-27 7:59 GMT+08:00 Andrew Morton [off-list ref]:
On Fri, 22 Sep 2017 07:12:32 +0800 Yafang Shao [off-list ref] wrote:quoted
we can find the logic in domain_dirty_limits() that when dirty bg_thresh is bigger than dirty thresh, bg_thresh will be set as thresh * 1 / 2. if (bg_thresh >= thresh) bg_thresh = thresh / 2; But actually we can set vm background dirtiness bigger than vm dirtiness successfully. This behavior may mislead us. We'd better do this validity check at the beginning. ...--- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt@@ -156,6 +156,9 @@ read. 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 cannot be set lower than +dirty_background_bytes or the amount of memory corresponding to +dirty_background_ratio.I think this means that a script which alters both dirty_bytes and dirty_background_bytes must alter dirty_background_bytes first if they are being decreased and must alter dirty_bytes first if they are being increased. Or something like that.
Yes.
And existing scripts which do not do this will cease to work correctly, no?
The existing scritpts won't work correctly. That's also what I have worried before. But under this condition, there's a error message generated by "sysctl -w" to tell them the first setting was failure. This error message may be a reminder to them that there are some connections between background and direct limit, and should not set arbitrary. May that's better. I'm not sure. Thanks Yafang -- 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>