[PATCH v2 0/5] mm: cleanups for device-exclusive entries (hmm)

From: David Hildenbrand
Date: Wed Feb 26 2025 - 08:23:10 EST


Based on mm/mm-unstable, which already contains [1].

Some smaller device-exclusive cleanups I have lying around. Tested
using the hmm selftests without surprises.

Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: "Jérôme Glisse" <jglisse@xxxxxxxxxx>
Cc: Simona Vetter <simona@xxxxxxxx>
Cc: Alistair Popple <apopple@xxxxxxxxxx>
Cc: Jason Gunthorpe <jgg@xxxxxxxxxx>

v1 -> v2:
* Rebased on top of [1]
* "mm/memory: remove PageAnonExclusive sanity-check in
restore_exclusive_pte()"
-> Added
* "mm/memory: document restore_exclusive_pte()"
-> adjust/clarify/simplify documentation
* "mm/mmu_notifier: use MMU_NOTIFY_CLEAR in
remove_device_exclusive_entry()"
-> Use MMU_NOTIFY_EXCLUSIVE only for a single purpose such that we
always have the owner

[1] https://lkml.kernel.org/r/20250210193801.781278-1-david@xxxxxxxxxx

David Hildenbrand (5):
lib/test_hmm: make dmirror_atomic_map() consume a single page
mm/memory: remove PageAnonExclusive sanity-check in
restore_exclusive_pte()
mm/memory: pass folio and pte to restore_exclusive_pte()
mm/memory: document restore_exclusive_pte()
mm/mmu_notifier: use MMU_NOTIFY_CLEAR in
remove_device_exclusive_entry()

include/linux/mmu_notifier.h | 8 ++---
lib/test_hmm.c | 32 ++++++-------------
mm/memory.c | 60 ++++++++++++++++++++++++------------
3 files changed, 55 insertions(+), 45 deletions(-)


base-commit: 598d34afeca6bb10554846cf157a3ded8729516c
--
2.48.1