]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/memory: pass folio and pte to restore_exclusive_pte()
authorDavid Hildenbrand <david@redhat.com>
Wed, 26 Feb 2025 13:22:55 +0000 (14:22 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 01:00:37 +0000 (17:00 -0800)
commitc1b48989794737b7f3900f92be5e3a8d91146fc0
treef0451932f10e093c3703e46fd5e27d2bce488835
parentfc4d22d4160c5f588a71dd3cb8c290ba52652719
mm/memory: pass folio and pte to restore_exclusive_pte()

Let's pass the folio and the pte to restore_exclusive_pte(), so we can
avoid repeated page_folio() and ptep_get().  To do that, pass the pte to
try_restore_exclusive_pte() and use a folio in there already.

While at it, just avoid the "swp_entry_t entry" variable in
try_restore_exclusive_pte() and add a folio-locked check to
restore_exclusive_pte().

Link: https://lkml.kernel.org/r/20250226132257.2826043-4-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: 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