Re: [PATCH] mm: fix setting the high and low watermarks

From: Mel Gorman
Date: Fri Jun 21 2019 - 10:20:54 EST


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-seem-higher-than-predicted-by-documentation-sysctl-vm/525687
>
> Signed-off-by: Alan Jenkins <alan.christopher.jenkins@xxxxxxxxx>
> Fixes: 1c30844d2dfe ("mm: reclaim small amounts of memory when an external
> fragmentation event occurs")
> Cc: stable@xxxxxxxxxxxxxxx

Either way

Acked-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>

--
Mel Gorman
SUSE Labs