* [PATCH v4 0/1] mm/page_alloc: auto-tune watermarks on atomic allocation failure
@ 2026-01-06 6:19 wujing
0 siblings, 0 replies; only message in thread
From: wujing @ 2026-01-06 6:19 UTC (permalink / raw)
To: Andrew Morton
Cc: Vlastimil Babka, Matthew Wilcox, Lance Yang, David Hildenbrand,
Michal Hocko, Johannes Weiner, Brendan Jackman,
Suren Baghdasaryan, Zi Yan, Mike Rapoport, Qi Zheng,
Shakeel Butt, linux-mm, netdev, linux-kernel, wujing
wujing (1):
mm/page_alloc: auto-tune watermarks on atomic allocation failure
include/linux/mmzone.h | 2 ++
mm/page_alloc.c | 55 +++++++++++++++++++++++++++++++++++++++---
Hi Andrew, Vlastimil, Michal, and others,
This is v4 of the patch to introduce reactive auto-tuning for GFP_ATOMIC
allocations. This version incorporates significant architectural
refinements based on feedback from Michal Hocko and the community.
### Addressing Michal Hocko's Feedback (v3 -> v4):
1. "Reactive is too late":
Michal correctly noted that boosting only after failure is
sub-optimal for non-sleepable contexts.
-> v4 introduces **Proactive Soft-Boosting**. When a GFP_ATOMIC request
enters the slowpath but has not yet failed, a lightweight boost is
triggered, replenishing reserves *before* exhaustion occurs.
2. "Use watermark_scale_factor instead of complex knobs":
Michal suggested that scaling the reclaim aggressiveness is more
idiomatic than just boosting the watermarks.
-> v4 implements **Hybrid Tuning**. We now introduce
`zone->watermark_scale_boost`. When pressure is detected, we not
only boost the base watermark (via boost_watermark) but also
temporarily increase the recovery aggressiveness (via scaling).
3. "Smooth transition":
There were concerns about the "cliff-edge" effect of resetting tuning
parameters instantly.
-> v4 implements **Gradual Decay** for the scale boost (-5 per
kswapd cycle), ensuring a stable fallback to the baseline.
### Core v4 Optimizations:
1. Per-Zone Debounce: Moved the 10s debounce timer to struct zone to
ensure independent pressure responses across NUMA nodes.
2. Scaled Boosting Intensity: Boost strength is now dynamically scaled
by ~0.1% of managed pages, ensuring TB-scale systems get a
meaningful response.
3. Precision Pathing: Both failure-path and proactive boosts now only
target the preferred zone (precision break) to prevent unnecessary
background reclaim overhead.
4. Strict Bitmask Verification: Tightened the tuning trigger to a
strict (gfp_mask & GFP_ATOMIC) == GFP_ATOMIC check to focus solely
on mission-critical allocations.
Testing in simulated burst environments shows that the combination of
proactive boosting and hybird scaling provides a significantly
more robust defense against packet drops than simple reactive boosting alone.
Special thanks to Vlastimil Babka, Andrew Morton, Matthew Wilcox, Lance Yang,
and Michal Hocko for the foundational critiques that led to this design.
Thanks for the reviews!
---
wujing (1):
mm/page_alloc: auto-tune watermarks on atomic allocation failure
include/linux/mmzone.h | 2 ++
mm/page_alloc.c | 55 +++++++++++++++++++++++++++++++++++++++---
mm/vmscan.c | 10 ++++++++
3 files changed, 64 insertions(+), 3 deletions(-)
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-06 6:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-06 6:19 [PATCH v4 0/1] mm/page_alloc: auto-tune watermarks on atomic allocation failure wujing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox