Skip to content

Commit f1385ec

Browse files
RichardWeiYanggregkh
authored andcommitted
mm/khugepaged: fix the address passed to notifier on testing young
[ Upstream commit 394bfac ] Commit 8ee5382 ("thp: mmu_notifier_test_young") introduced mmu_notifier_test_young(), but we are passing the wrong address. In xxx_scan_pmd(), the actual iteration address is "_address" not "address". We seem to misuse the variable on the very beginning. Change it to the right one. [akpm@linux-foundation.org fix whitespace, per everyone] Link: https://lkml.kernel.org/r/20250822063318.11644-1-richard.weiyang@gmail.com Fixes: 8ee5382 ("thp: mmu_notifier_test_young") Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: Dev Jain <dev.jain@arm.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: Nico Pache <npache@redhat.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Barry Song <baohua@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 429ed0a commit f1385ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/khugepaged.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,8 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
12761276
*/
12771277
if (cc->is_khugepaged &&
12781278
(pte_young(pteval) || folio_test_young(folio) ||
1279-
folio_test_referenced(folio) || mmu_notifier_test_young(vma->vm_mm,
1280-
address)))
1279+
folio_test_referenced(folio) ||
1280+
mmu_notifier_test_young(vma->vm_mm, _address)))
12811281
referenced++;
12821282
}
12831283
if (!writable) {

0 commit comments

Comments
 (0)