mm/rmap: warn on new PTE-mapped folios in page_add_anon_rmap()
authorDavid Hildenbrand <david@redhat.com>
Wed, 13 Sep 2023 12:51:11 +0000 (14:51 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:32:27 +0000 (10:32 -0700)
commita1f34ee1de2c3a55bc2a6b9a38e1ecd2830dcc03
tree44acea591034a24142863e9c03bd0781a853e2c8
parentc5c540034747dfe450f64d1151081a6080daa8f9
mm/rmap: warn on new PTE-mapped folios in page_add_anon_rmap()

If swapin code would ever decide to not use order-0 pages and supply a
PTE-mapped large folio, we will have to change how we call
__folio_set_anon() -- eventually with exclusive=false and an adjusted
address.  For now, let's add a VM_WARN_ON_FOLIO() with a comment about the
situation.

Link: https://lkml.kernel.org/r/20230913125113.313322-5-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>
mm/rmap.c