Thread (1 message) flat view 1 message, 1 author, 2026-01-05
STALE241d

Revision v2 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v2 current

[PATCH v2 0/1] mm/page_alloc: dynamic min_free_kbytes adjustment

From: wujing <hidden>
Date: 2026-01-05 08:17:33
Also in: linux-mm, lkml

This is v2 of the auto-tuning patch, addressing feedback from Andrew Morton
and Matthew Wilcox.

## Responses to Andrew Morton's feedback:
"But no attempt to reduce it again after the load spike has gone away."
v2 implements a decay mechanism: min_free_kbytes automatically reduces by 5%
every 5 minutes after being increased. However, it stops at 1.2x the initial
value rather than returning to baseline, ensuring the system "remembers"
previous pressure patterns.
"Probably this should be selectable and tunable via a kernel boot parameter
or a procfs tunable."
Per Matthew Wilcox's preference to avoid new tunables, v2 implements an
algorithm designed to work automatically without configuration. The parameters
(50% increase, 5% decay, 10s debounce) are chosen to be responsive yet stable.
"Can I suggest that you engage with [the networking people]? netdev@"
Done - netdev@ is now CC'd on this v2 submission.

## Responses to Matthew Wilcox's feedback:
"Is doubling too aggressive? Would an increase of, say, 10% or 20% be more
appropriate?"
v2 uses a 50% increase (compromise between responsiveness and conservatism).
20% felt too slow for burst traffic scenarios based on our observations.
"Do we have to wait for failure before increasing? Could we schedule the
increase for when we get to within, say, 10% of the current limit?"
We considered proactive monitoring but concluded it would add overhead and
complexity. The debounce mechanism (10s) ensures we don't thrash while still
being reactive.
"Hm, how would we do that? Automatically decay by 5%, 300 seconds after
increasing; then schedule another decay for 300 seconds after that..."
Exactly as you suggested! v2 implements this decay chain. The only addition
is stopping at 1.2x baseline to preserve learning.
"Ugh, please, no new tunables. Let's just implement an algorithm that works."
Agreed - v2 has zero new tunables.

## Changes in v2:
- Reduced aggressiveness: +50% increase instead of doubling
- Added debounce: Only trigger once per 10 seconds to prevent storms
- Added decay: Automatically reduce by 5% every 5 minutes
- Preserve learning: Decay stops at 1.2x initial value, not baseline
- Engaged networking community (netdev@)

Thanks for the thoughtful reviews!

wujing (1):
  mm/page_alloc: auto-tune min_free_kbytes on atomic allocation failure

 mm/page_alloc.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

-- 
2.39.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help