Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Michal Clapinski and committed by
Andrew Morton
98c93890 bb317f00

+9 -2
+6
Documentation/admin-guide/sysctl/vm.rst
··· 131 131 various heuristics to avoid wasting CPU cycles if it detects that 132 132 proactive compaction is not being effective. 133 133 134 + Setting the value above 80 will, in addition to lowering the acceptable level 135 + of fragmentation, make the compaction code more sensitive to increases in 136 + fragmentation, i.e. compaction will trigger more often, but reduce 137 + fragmentation by a smaller amount. 138 + This makes the fragmentation level more stable over time. 139 + 134 140 Be careful when setting it to extreme values like 100, as that may 135 141 cause excessive background compaction activity. 136 142
+3 -2
mm/compaction.c
··· 2249 2249 2250 2250 static unsigned int fragmentation_score_wmark(bool low) 2251 2251 { 2252 - unsigned int wmark_low; 2252 + unsigned int wmark_low, leeway; 2253 2253 2254 2254 wmark_low = 100U - sysctl_compaction_proactiveness; 2255 - return low ? wmark_low : min(wmark_low + 10, 100U); 2255 + leeway = min(10U, wmark_low / 2); 2256 + return low ? wmark_low : min(wmark_low + leeway, 100U); 2256 2257 } 2257 2258 2258 2259 static bool should_proactive_compact_node(pg_data_t *pgdat)