* + mm-compaction-reduce-the-difference-between-low-and-high-watermarks.patch added to mm-new branch
@ 2025-04-06 23:23 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-04-06 23:23 UTC (permalink / raw)
To: mm-commits, vbabka, mgorman, mclapinski, akpm
The patch titled
Subject: mm/compaction: reduce the difference between low and high watermarks
has been added to the -mm mm-new branch. Its filename is
mm-compaction-reduce-the-difference-between-low-and-high-watermarks.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-compaction-reduce-the-difference-between-low-and-high-watermarks.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Michal Clapinski <mclapinski@google.com>
Subject: mm/compaction: reduce the difference between low and high watermarks
Date: Fri, 4 Apr 2025 13:11:03 +0200
Reduce the diff between low and high watermarks when compaction
proactiveness is set to high. This allows users who set the proactiveness
really high to have more stable fragmentation score over time.
Link: https://lkml.kernel.org/r/20250404111103.1994507-3-mclapinski@google.com
Signed-off-by: Michal Clapinski <mclapinski@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/admin-guide/sysctl/vm.rst | 6 ++++++
mm/compaction.c | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
--- a/Documentation/admin-guide/sysctl/vm.rst~mm-compaction-reduce-the-difference-between-low-and-high-watermarks
+++ a/Documentation/admin-guide/sysctl/vm.rst
@@ -131,6 +131,12 @@ to latency spikes in unsuspecting applic
various heuristics to avoid wasting CPU cycles if it detects that
proactive compaction is not being effective.
+Setting the value above 80 will, in addition to lowering the acceptable level
+of fragmentation, make the compaction code more sensitive to increases in
+fragmentation, i.e. compaction will trigger more often, but reduce
+fragmentation by a smaller amount.
+This makes the fragmentation level more stable over time.
+
Be careful when setting it to extreme values like 100, as that may
cause excessive background compaction activity.
--- a/mm/compaction.c~mm-compaction-reduce-the-difference-between-low-and-high-watermarks
+++ a/mm/compaction.c
@@ -2249,10 +2249,11 @@ static unsigned int fragmentation_score_
static unsigned int fragmentation_score_wmark(bool low)
{
- unsigned int wmark_low;
+ unsigned int wmark_low, leeway;
wmark_low = 100U - sysctl_compaction_proactiveness;
- return low ? wmark_low : min(wmark_low + 10, 100U);
+ leeway = min(10U, wmark_low / 2);
+ return low ? wmark_low : min(wmark_low + leeway, 100U);
}
static bool should_proactive_compact_node(pg_data_t *pgdat)
_
Patches currently in -mm which might be from mclapinski@google.com are
mm-compaction-remove-low-watermark-cap-for-proactive-compaction.patch
mm-compaction-reduce-the-difference-between-low-and-high-watermarks.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-06 23:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-06 23:23 + mm-compaction-reduce-the-difference-between-low-and-high-watermarks.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.