lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_B8B6D067EF7417B3B0D3DCC1A01505453F05@qq.com>
Date: Tue,  6 Jan 2026 14:19:49 +0800
From: wujing <realwujing@...com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Vlastimil Babka <vbabka@...e.cz>,
	Matthew Wilcox <willy@...radead.org>,
	Lance Yang <lance.yang@...ux.dev>,
	David Hildenbrand <david@...nel.org>,
	Michal Hocko <mhocko@...e.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Brendan Jackman <jackmanb@...gle.com>,
	Suren Baghdasaryan <surenb@...gle.com>,
	Zi Yan <ziy@...dia.com>,
	Mike Rapoport <rppt@...nel.org>,
	Qi Zheng <zhengqi.arch@...edance.com>,
	Shakeel Butt <shakeel.butt@...ux.dev>,
	linux-mm@...ck.org,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	wujing <realwujing@...com>
Subject: [PATCH v4 0/1] mm/page_alloc: auto-tune watermarks on atomic allocation failure


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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ