[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_D4B501852276CE87F53409B3B5F3C9E1AD05@qq.com>
Date: Mon, 5 Jan 2026 16:17:19 +0800
From: wujing <realwujing@...com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>
Cc: Matthew Wilcox <willy@...radead.org>,
Lance Yang <lance.yang@...ux.dev>,
Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>,
Brendan Jackman <jackmanb@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Zi Yan <ziy@...dia.com>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
Qiliang Yuan <yuanql9@...natelecom.cn>,
wujing <realwujing@...com>
Subject: [PATCH v2 0/1] mm/page_alloc: dynamic min_free_kbytes adjustment
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
Powered by blists - more mailing lists