diff options
author | David Hildenbrand <david@redhat.com> | 2023-09-13 14:51:12 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-10-04 19:32:27 +0200 |
commit | 132b180f06a74ddfc526709928036db3b7a1cf6d (patch) | |
tree | 334eadd59db3cfef2d05b32f05438bd8378aebf0 /mm/migrate_device.c | |
parent | mm/rmap: warn on new PTE-mapped folios in page_add_anon_rmap() (diff) | |
download | linux-132b180f06a74ddfc526709928036db3b7a1cf6d.tar.xz linux-132b180f06a74ddfc526709928036db3b7a1cf6d.zip |
mm/rmap: simplify PageAnonExclusive sanity checks when adding anon rmap
Let's sanity-check PageAnonExclusive vs. mapcount in page_add_anon_rmap()
and hugepage_add_anon_rmap() after setting PageAnonExclusive simply by
re-reading the mapcounts.
We can stop initializing the "first" variable in page_add_anon_rmap() and
no longer need an atomic_inc_and_test() in hugepage_add_anon_rmap().
While at it, switch to VM_WARN_ON_FOLIO().
[david@redhat.com: update check for doubly-mapped page]
Link: https://lkml.kernel.org/r/d8e5a093-2e22-c14b-7e64-6da280398d9f@redhat.com
Link: https://lkml.kernel.org/r/20230913125113.313322-6-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/migrate_device.c')
0 files changed, 0 insertions, 0 deletions