diff options
| author | Dev Jain <[email protected]> | 2025-08-06 14:56:11 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-08-12 06:00:59 +0000 |
| commit | cf1b80dc31a1137b8b4568c138b453bf7453204a (patch) | |
| tree | 2d6078761aacbed095c76f9f709ec8ab71ca07a6 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
| parent | selftests/proc: fix string literal warning in proc-maps-race.c (diff) | |
| download | kernel-cf1b80dc31a1137b8b4568c138b453bf7453204a.tar.gz kernel-cf1b80dc31a1137b8b4568c138b453bf7453204a.zip | |
mm: pass page directly instead of using folio_page
In commit_anon_folio_batch(), we iterate over all pages pointed to by the
PTE batch. Therefore we need to know the first page of the batch;
currently we derive that via folio_page(folio, 0), but, that takes us to
the first (head) page of the folio instead - our PTE batch may lie in the
middle of the folio, leading to incorrectness.
Bite the bullet and throw away the micro-optimization of reusing the folio
in favour of code simplicity. Derive the page and the folio in
change_pte_range, and pass the page too to commit_anon_folio_batch to fix
the aforementioned issue.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: cac1db8c3aad ("mm: optimize mprotect() by PTE batching")
Reported-by: [email protected]
Signed-off-by: Dev Jain <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Debugged-by: David Hildenbrand <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Joey Gouly <[email protected]>
Cc: Kevin Brodsky <[email protected]>
Cc: Lance Yang <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Matthew Wilcox (Oracle) <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Yicong Yang <[email protected]>
Cc: Zhenhua Huang <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
0 files changed, 0 insertions, 0 deletions
