[PATCH v4 1/2] mm/compaction: remove low watermark cap for proactive compaction

From: Michal Clapinski
Date: Fri Apr 04 2025 - 07:11:42 EST


Previously a min cap of 5 has been set in the commit introducing
proactive compaction. This was to make sure users don't hurt themselves
by setting the proactiveness to 100 and making their system
unresponsive. But the compaction mechanism has a backoff mechanism that
will sleep for 30s if no progress is made, so I don't see a significant
risk here. My system (19GB of memory) has been perfectly fine with both
watermarks hardcoded to 0.

Signed-off-by: Michal Clapinski <mclapinski@xxxxxxxxxx>
---
mm/compaction.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index a3203d97123ea..4ff6b6e1db2da 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2251,12 +2251,7 @@ static unsigned int fragmentation_score_wmark(bool low)
{
unsigned int wmark_low;

- /*
- * Cap the low watermark to avoid excessive compaction
- * activity in case a user sets the proactiveness tunable
- * close to 100 (maximum).
- */
- wmark_low = max(100U - sysctl_compaction_proactiveness, 5U);
+ wmark_low = 100U - sysctl_compaction_proactiveness;
return low ? wmark_low : min(wmark_low + 10, 100U);
}

--
2.49.0.504.g3bcea36a83-goog