On Fri, Jun 21, 2019 at 12:43:25PM +0100, Alan Jenkins wrote:
When setting the low and high watermarks we use min_wmark_pages(zone). I guess this is to reduce the line length. But we forgot that this macro includes zone->watermark_boost. We need to reset zone->watermark_boost first. Otherwise the watermarks will be set inconsistently.
E.g. this could cause inconsistent values if the watermarks have been boosted, and then you change a sysctl which triggers __setup_per_zone_wmarks().
I strongly suspect this explains why I have seen slightly high watermarks. Suspicious-looking zoneinfo below - notice high-low != low-min.
Node 0, zone Normal pages free 74597 min 9582 low 34505 high 36900
https://unix.stackexchange.com/questions/525674/my-low-and-high-watermarks-s...
Signed-off-by: Alan Jenkins alan.christopher.jenkins@gmail.com Fixes: 1c30844d2dfe ("mm: reclaim small amounts of memory when an external fragmentation event occurs") Cc: stable@vger.kernel.org
Either way
Acked-by: Mel Gorman mgorman@techsingularity.net