v2
2026-10-21
mTHP友好的内存压缩 · v2
RFC 让 kcompactd 主动压缩按 mTHP order 参数化碎片评分,跳过已满足的大 folio 和不可移动块。
原始补丁链接
子 Patch(4)
1/4
mm: compaction: parameterize fragmentation score by order
The proactive compaction fragmentation score functions are hardwired to COMPACTION_HPAGE_ORDER (typically order-9 for 2MB THP). To later allow proactive compaction to target other orders (e.g. smaller
2/4
mm: compaction: target mTHP order for proactive compaction
Proactive compaction triggers against COMPACTION_HPAGE_ORDER (order-9), which is too heavyweight and misdirected for mTHP systems where the pressure is on smaller orders like order-2. Add compact_hpa
3/4
mm: compaction: skip isolating large folios that already satisfy mTHP
When proactive compaction is triggered via compact_memory and mTHP always-enabled orders are configured, skip isolating folios whose order is >= the maximum always-enabled mTHP order. These folios alr
4/4
mm: compaction: skip unmovable blocks for non-costly proactive mTHP compaction
Proactive compaction scans all pageblocks including unmovable/reclaimable ones. For non-costly mTHP orders (<= PAGE_ALLOC_COSTLY_ORDER), those blocks are dominated by non-migratable kernel allocations