]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: scale kswapd watermarks in proportion to memory
authorJohannes Weiner <hannes@cmpxchg.org>
Thu, 17 Mar 2016 21:19:14 +0000 (14:19 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 21 Sep 2017 22:21:33 +0000 (15:21 -0700)
commit1d351b23d294543ab6eff9910040029d3008464f
treeccb04ad7bbde393d1379b06b9f619ba3a479530f
parent902f8f14e1b50e37340251947856d22d1e2a6fc4
mm: scale kswapd watermarks in proportion to memory

In machines with 140G of memory and enterprise flash storage, we have
seen read and write bursts routinely exceed the kswapd watermarks and
cause thundering herds in direct reclaim.  Unfortunately, the only way
to tune kswapd aggressiveness is through adjusting min_free_kbytes - the
system's emergency reserves - which is entirely unrelated to the
system's latency requirements.  In order to get kswapd to maintain a
250M buffer of free memory, the emergency reserves need to be set to 1G.
That is a lot of memory wasted for no good reason.

On the other hand, it's reasonable to assume that allocation bursts and
overall allocation concurrency scale with memory capacity, so it makes
sense to make kswapd aggressiveness a function of that as well.

Change the kswapd watermark scale factor from the currently fixed 25% of
the tunable emergency reserve to a tunable 0.1% of memory.

Beyond 1G of memory, this will produce bigger watermark steps than the
current formula in default settings.  Ensure that the new formula never
chooses steps smaller than that, i.e.  25% of the emergency reserve.

On a 140G machine, this raises the default watermark steps - the
distance between min and low, and low and high - from 16M to 143M.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 795ae7a0de6b834a0cc202aa55c190ef81496665)

Orabug: 26643957

Signed-off-by: Robert M. Harris <robert.m.harris@oracle.com>
Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Reviewed-by: Larry Bassel <larry.bassel@oracle.com>
Reviewed-by: Herbert van den Bergh <herbert.van.den.bergh@oracle.com>
Reviewed-by: Todd Vierling <todd.vierling@oracle.com>
Documentation/sysctl/vm.txt
include/linux/mm.h
include/linux/mmzone.h
kernel/sysctl.c
mm/page_alloc.c