v1
2026-09-07
mTHP友好的内存压缩 · v1
让内存压缩面向mTHP:碎片评分按阶数参数化,跳过已满足mTHP的folio,并允许与kswapd并发压缩。
原始补丁链接
子 Patch(4)
1/4
mm: compaction: make proactive compaction mTHP-aware
Currently, proactive compaction only evaluates fragmentation relative to COMPACTION_HPAGE_ORDER (typically order-9 for 2MB THP). This makes it unsuitable for systems that primarily need smaller high-o
2/4
mm: compaction: skip isolating large folios that satisfy the mTHP order
When proactive compaction is triggered via compact_memory and mTHP always-enabled orders are configured, skip isolating folios whose order is >= the minimum always-enabled mTHP order. These folios alr
3/4
mm: compaction: don't skip proactive compaction for non-costly mTHP
When the minimum always-enabled mTHP order is below PAGE_ALLOC_COSTLY_ORDER, do not skip proactive compaction even if kswapd is running. For these non-costly mTHP orders, kswapd reclaim alone may not
4/4
mm: adjust free_pages to make __zone_watermark_ok() mTHP-aware
To improve the mTHP allocation success rate and reduce fragmentation over time, introduce zone_effective_free_pages() for mTHP-aware free page accounting. Refactor the free page counting logic used b