Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: use ptep_get() instead of directly dereferencing pte_t*

It is best practice for all pte accesses to go via the arch helpers, to
ensure non-torn values and to allow the arch to intervene where needed
(contpte for arm64 for example). While in this case it was probably safe
to directly dereference, let's tidy it up for consistency.

Link: https://lkml.kernel.org/r/20250310140418.1737409-1-ryan.roberts@arm.com
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Ryan Roberts and committed by
Andrew Morton
5d89666b 1a24776f

+1 -1
+1 -1
mm/migrate.c
··· 202 202 return false; 203 203 VM_BUG_ON_PAGE(!PageAnon(page), page); 204 204 VM_BUG_ON_PAGE(!PageLocked(page), page); 205 - VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page); 205 + VM_BUG_ON_PAGE(pte_present(ptep_get(pvmw->pte)), page); 206 206 207 207 if (folio_test_mlocked(folio) || (pvmw->vma->vm_flags & VM_LOCKED) || 208 208 mm_forbids_zeropage(pvmw->vma->vm_mm))