summaryrefslogtreecommitdiff
path: root/mm/compaction.c
diff options
context:
space:
mode:
authorMichal Clapinski <mclapinski@google.com>2025-04-04 13:11:03 +0200
committerAndrew Morton <akpm@linux-foundation.org>2025-05-11 17:48:10 -0700
commit98c9389042f4d1e6aa73fbaf79e2e962c9497fc5 (patch)
treeb80454b5866955a947603340fd58f07a1ced4c5f /mm/compaction.c
parentbb317f00b9b7f59de5a2ef512a76a1ae285bd23f (diff)
mm/compaction: reduce the difference between low and high watermarks
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>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index f9ee06d55726..fe51a73b91a7 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2249,10 +2249,11 @@ static unsigned int fragmentation_score_node(pg_data_t *pgdat)
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)