v1
2026-09-01
修复DAMOS多处缺陷 · v1
DAMOS 补丁系列修复 9 项:降低极端内存分配压力、修正 PSI quota 自调反馈起点、修复 paddr/vaddr folio 遍历错误、处理除零/下溢。
原始补丁链接
子 Patch(9)
1/9
mm/damon/core: skip applying scheme if region split for quota fails
damos_apply_scheme() splits a region and apply the action to the subregion if it is needed for not violating the quota. The split operation (damon_split_region_at()) could fail for allocation failure
2/9
mm/damon/core: initialize damos_quota_goal->last_psi_total
When DAMOS_QUOTA_SOME_MEM_PSI_US metric damos quota goal is set, the PSI delta for the feedback loop is calculated using damos_quota_goal->last_psi_total. It is not initialized at the beginning. So
3/9
mm/damon/paddr: respect folio end for DAMOS_STAT
The function for applying DAMOS_STAT in DAMON physical address space operation set (paddr), namely damon_pa_stat(), applies DAMOS filters to folios of the given region. For that, it gets folios of ad
4/9
mm/damon/paddr: respect folio end for DAMOS actions except STAT
A few functions for applying DAMOS actions including pageout, lru_[de]prio and migrate_{hot,cold} in DAMON physical address space operation set (paddr) collect folios of the given region by getting th
5/9
mm/damon/vaddr: respect folio end for DAMOS_STAT
For applying DAMOS_STAT action to a region, DAMON virtual address space operation set (vaddr) calls walk_page_range_vma for the region. The pmd walk entry function, namely damon_va_stat_pmd_entry
6/9
mm/damon/vaddr: respect folio end for DAMOS_MIGRATE_{HOT,COLD}
For applying DAMOS_MIGRATE_{HOT,COLD} actions to a region, DAMON virtual address space operation set (vaddr) calls walk_page_range_vma for the region. The pmd walk entry function, namely damon_va
7/9
mm/damon/core: handle extreme memory state in damon_get_node_mem_bp()
In an extreme and unlikely situation, si_meminfo_node() might let the caller show zero total ram. That could cause a divide by zero in damon_get_node_mem_bp(). Fix it by setting the totalram one byt
8/9
mm/damon/core: handle extreme memory state in get_node_memcg_used_bp()
In extreme unlikely situations, total memory might be zero. In less extreme but still very unlikely situations, lruvec_page_state() calls might let the caller show used memory larger than total memor
9/9
mm/damon/core: handle extreme memory state in get_in_active_mem_bp()
damon_get_intervals_adaptation_bp() uses the sum of the active and inactive memory amount as a denominator. In an extreme and unlikely environment, active and inactive memory might be zero. In this