David Hildenbrand ebe2e35ec0 mm/rmap: introduce and use hugetlb_try_dup_anon_rmap()
hugetlb rmap handling differs quite a lot from "ordinary" rmap code.  For
example, hugetlb currently only supports entire mappings, and treats any
mapping as mapped using a single "logical PTE".  Let's move it out of the
way so we can overhaul our "ordinary" rmap.  implementation/interface.

So let's introduce and use hugetlb_try_dup_anon_rmap() to make all hugetlb
handling use dedicated hugetlb_* rmap functions.

Add sanity checks that we end up with the right folios in the right
functions.

Note that is_device_private_page() does not apply to hugetlb.

Link: https://lkml.kernel.org/r/20231220224504.646757-5-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-12-29 11:58:48 -08:00
..
2023-09-08 12:16:52 -07:00
2023-06-09 16:25:17 -07:00
2023-06-19 16:19:25 -07:00
2023-12-29 11:58:24 -08:00
2023-12-12 10:57:08 -08:00
2023-12-29 11:58:27 -08:00
2023-04-12 17:36:23 -07:00
2022-10-03 14:02:43 -07:00
2023-10-04 10:32:19 -07:00
2023-10-30 18:01:41 -10:00
2023-10-25 16:47:11 -07:00
2023-06-23 16:59:30 -07:00
2023-12-29 11:58:32 -08:00
2023-04-12 17:36:23 -07:00
2023-12-29 11:58:29 -08:00