From: David Rientjes <rientjes@google.com>
To: Alan Jenkins <alan.christopher.jenkins@gmail.com>
Cc: linux-mm@kvack.org, Vlastimil Babka <vbabka@suse.cz>,
Mel Gorman <mgorman@techsingularity.net>,
linux-kernel@vger.kernel.org,
Bharath Vedartham <linux.bhar@gmail.com>
Subject: Re: [PATCH v2] mm: avoid inconsistent "boosts" when updating the high and low watermarks
Date: Fri, 21 Jun 2019 13:58:08 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.21.1906211357560.77141@chino.kir.corp.google.com> (raw)
In-Reply-To: <20190621153107.23667-1-alan.christopher.jenkins@gmail.com>
On Fri, 21 Jun 2019, Alan Jenkins wrote:
> When setting the low and high watermarks we use min_wmark_pages(zone).
> I guess this was to reduce the line length. Then this macro was modified
> to include zone->watermark_boost. So we needed to set watermark_boost
> before we set the high and low watermarks... but we did not.
>
> It seems mostly harmless. It might set the watermarks a bit higher than
> needed: when 1) the watermarks have been "boosted" and 2) you then
> triggered __setup_per_zone_wmarks() (by setting one of the sysctls, or
> hotplugging memory...).
>
> I noticed it because it also breaks the documented equality
> (high - low == low - min). Below is an example of reproducing the bug.
>
> First sample. Equality is met (high - low == low - min):
>
> Node 0, zone Normal
> pages free 11962
> min 9531
> low 11913
> high 14295
> spanned 1173504
> present 1173504
> managed 1134235
>
> A later sample. Something has caused us to boost the watermarks:
>
> Node 0, zone Normal
> pages free 12614
> min 10043
> low 12425
> high 14807
>
> Now trigger the watermarks to be recalculated. "cd /proc/sys/vm" and
> "cat watermark_scale_factor > watermark_scale_factor". Then the watermarks
> are boosted inconsistently. The equality is broken:
>
> Node 0, zone Normal
> pages free 12412
> min 9531
> low 12425
> high 14807
>
> 14807 - 12425 = 2382
> 12425 - 9531 = 2894
>
> Co-developed-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
> Fixes: 1c30844d2dfe ("mm: reclaim small amounts of memory when an external
> fragmentation event occurs")
> Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: David Rientjes <rientjes@google.com>
next prev parent reply other threads:[~2019-06-21 20:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 11:43 [PATCH] mm: fix setting " Alan Jenkins
2019-06-21 12:09 ` Vlastimil Babka
2019-06-21 14:07 ` Bharath Vedartham
2019-06-24 5:46 ` Vlastimil Babka
2019-06-21 15:31 ` [PATCH v2] mm: avoid inconsistent "boosts" when updating " Alan Jenkins
2019-06-21 20:58 ` David Rientjes [this message]
2019-06-21 14:16 ` [PATCH] mm: fix setting " Mel Gorman
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=alpine.DEB.2.21.1906211357560.77141@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=alan.christopher.jenkins@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux.bhar@gmail.com \
--cc=mgorman@techsingularity.net \
--cc=vbabka@suse.cz \
/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