mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] mm: implement and use vma_has_anon_rmap(), silence KCSAN
@ 2026-09-17 19:47 Lorenzo Stoakes (ARM)
  2026-09-17 19:47 ` [PATCH v3 1/3] mm/vma: const-ify vma_assert_stabilised() and associated functions Lorenzo Stoakes (ARM)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-09-17 19:47 UTC (permalink / raw)
  To: Andrew Morton, Suren Baghdasaryan, Liam R. Howlett,
	Vlastimil Babka, Shakeel Butt, David Hildenbrand, Zi Yan,
	Baolin Wang, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
	Lance Yang, Usama Arif, Kiryl Shutsemau, Mike Rapoport,
	Michal Hocko, Xu Xin, Chengming Zhou, Jann Horn, Pedro Falcato,
	Rik van Riel, Harry Yoo, Chris Li, Kairui Song, Kemeng Shi,
	Nhat Pham, Baoquan He, Youngjun Park, Peter Xu, Muchun Song,
	Oscar Salvador, Matthew Brost, Joshua Hahn, Rakie Kim,
	Byungchul Park, Gregory Price, Ying Huang, Alistair Popple
  Cc: linux-mm, linux-kernel, Lorenzo Stoakes (ARM), Guilherme Giacomo Simoes

Provide a function to abstract the common task of checking whether
a VMA has an anonymous reverse mapping associated with it.

In the first patch, const-ify vma_assert_stabilised() and related
functions so that vma_has_anon_rmap() can reference a const vma pointer.

In the second patch, introduce vma_has_anon_rmap().

Finally in the third patch, update comments referencing anon_vma to instead
reference the anon rmap to abstract this conceptually to avoid confusion.

There are still other functions which reference anon_vma directly, those
can be addressed in a follow up.

Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
---
v3:
- Updated tags (thanks everybody!)
- Separated out const-ification changes as per Kiryl and Pedro.
- Renamed vma_anon_tracked() to vma_has_anon_rmap() as per Kiryl and Pedro.
- Converted the missed hugepage_vma_revalidate() and vma_needs_copy() callers
  as per Kiryl.
- Update the kdoc comment for vma_has_anon_rmap() to highlight that it implies
  anon folios may be associated with the VMA, as per David.
- Updated anon_vma comments as per David.
- Updated the vma_has_anon_rmap() patch commit message to avoid saying
fault as per David.
- Various prose improvements.

v2:
- Renamed vma_is_faulted() to vma_anon_tracked() as per David.
https://lore.kernel.org/r/20260910-vma-is-faulted-v2-1-e81ebc7d146b@kernel.org

v1:
https://lore.kernel.org/r/20260909-vma-is-faulted-v1-1-3a701f48984a@kernel.org

---
Lorenzo Stoakes (ARM) (3):
      mm/vma: const-ify vma_assert_stabilised() and associated functions
      mm: implement and use vma_has_anon_rmap(), silence KCSAN
      mm: update comments to refer to anon rmap rather than anon_vma

 include/linux/mmap_lock.h         |  12 ++--
 mm/huge_memory.c                  |  21 +++----
 mm/hugetlb.c                      |   2 +-
 mm/internal.h                     |   2 +-
 mm/khugepaged.c                   |  17 ++---
 mm/ksm.c                          |  16 ++---
 mm/madvise.c                      |  10 +--
 mm/memory.c                       |  16 ++---
 mm/migrate.c                      |  12 ++--
 mm/mmap.c                         |   6 +-
 mm/mprotect.c                     |   6 +-
 mm/mremap.c                       |  10 +--
 mm/pgtable-generic.c              |   2 +-
 mm/rmap.c                         |  22 +++----
 mm/swapfile.c                     |   2 +-
 mm/userfaultfd.c                  |  12 ++--
 mm/vma.c                          | 127 +++++++++++++++++++-------------------
 mm/vma.h                          |  29 ++++++++-
 tools/testing/vma/include/dup.h   |   2 +-
 tools/testing/vma/include/stubs.h |   4 ++
 20 files changed, 182 insertions(+), 148 deletions(-)
---
base-commit: b02c77c78ff74d3d88ea614335ae833e01ed5d30
change-id: 20260909-vma-is-faulted-3ed004535970

Best regards,
-- 
Lorenzo Stoakes (ARM) <ljs@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-17 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 19:47 [PATCH v3 0/3] mm: implement and use vma_has_anon_rmap(), silence KCSAN Lorenzo Stoakes (ARM)
2026-09-17 19:47 ` [PATCH v3 1/3] mm/vma: const-ify vma_assert_stabilised() and associated functions Lorenzo Stoakes (ARM)
2026-09-17 20:28   ` Zi Yan
2026-09-17 19:47 ` [PATCH v3 2/3] mm: implement and use vma_has_anon_rmap(), silence KCSAN Lorenzo Stoakes (ARM)
2026-09-17 19:47 ` [PATCH v3 3/3] mm: update comments to refer to anon rmap rather than anon_vma Lorenzo Stoakes (ARM)
2026-09-17 20:43   ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®