mm/damon/vaddr: fix missing pte_unmap_unlock in damos_va_migrate_pmd_entry()
Subsystems (2)
PATCH 1/1 mm/damon/vaddr: fix missing pte_unmap_unlock in damos_va_migrate_pmd_entry()
If the PTE page table lock is acquired by pte_offset_map_lock(), the lock must be released via pte_unmap_unlock().
However, in damos_va_migrate_pmd_entry(), if damos_va_filter_out() returns true, it immediately returns without releasing the lock.
This fixes the issue by not stopping page table traversal when damos_va_filter_out() returns true and ensuring that the lock is released.
--- mm/damon/vaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/damon/vaddr.c +1 -1
@@ -743,7 +743,7 @@ static int damos_va_migrate_pmd_entry(pmd_t *pmd, unsigned long addr,if (!folio)continue ;if (damos_va_filter_out (s, folio, walk->vma, addr, pte,NULL )) -return 0 ; +continue ;damos_va_migrate_dests_add (folio, walk->vma, addr, dests, migration_lists); nr =folio_nr_pages (folio);
Signature · 1 line
2.43.0
Quoted 8 lines · On Wed, 10 Dec 2025 00:10:34 +0900 Akinobu Mita <[email protected]> wrote:
If the PTE page table lock is acquired by
pte_offset_map_lock(), the lock must be released viapte_unmap_unlock().However, in
damos_va_migrate_pmd_entry(), ifdamos_va_filter_out()returns true, it immediately returns without releasing the lock.This fixes the issue by not stopping page table traversal when
damos_va_filter_out()returns true and ensuring that the lock is released.
Thank you for finding and fixing this!
Quoted 3 lines
Fixes 09efc56a3b1c ("mm/damon/vaddr: consistently use only pmd_entry for damos_migrate")Signed-off-by Akinobu Mita <[email protected]>
Thanks,
SJ
[...]