]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/memory: remove PageAnonExclusive sanity-check in restore_exclusive_pte()
authorDavid Hildenbrand <david@redhat.com>
Wed, 26 Feb 2025 13:22:54 +0000 (14:22 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 01:00:36 +0000 (17:00 -0800)
commitfc4d22d4160c5f588a71dd3cb8c290ba52652719
tree360432c1d4fdc9287d28441097883925b217eba9
parente10f3c6bad608a01a0876f530ef278b95c45fa22
mm/memory: remove PageAnonExclusive sanity-check in restore_exclusive_pte()

In commit b832a354d787 ("mm/memory: page_add_anon_rmap() ->
folio_add_anon_rmap_pte()") we accidentally changed the sanity check to
essentially ignore anonymous folio by mis-placing the "!" ...  but we
really always only get anonymous folios in restore_exclusive_pte().

However, in the meantime we removed the separate "writable
device-exclusive entries" and always detect if the PTE can be writable
using can_change_pte_writable() -- which also consults PageAnonExclusive.

So let's just get rid of this sanity check completely.

Link: https://lkml.kernel.org/r/20250226132257.2826043-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c