On 30.01.25 11:10, Simona Vetter wrote:
On Wed, Jan 29, 2025 at 12:54:06PM +0100, David Hildenbrand wrote:
Ever since commit b756a3b5e7ea ("mm: device exclusive memory access")
we can return with a device-exclusive entry from page_vma_mapped_walk().
try_to_unmap_one() is not prepared for that, so teach it about these
non-present nonswap PTEs.
Before that, could we also have triggered this case with device-private
entries? Unlikely.
Just quick comment on this, I'm still pondering all the other aspects.
device-private memory is entirely owned by the driver, the core mm isn't
supposed to touch these beyond migrating it back to system memory in
do_swap_page. Plus using rmap when the driver asks for invalidating
mappings as needed.
So no lru, thp, migration or anything initiated by core mm should ever
happen on these device private pages. If it does, it'd be a bug.
I was not 100% sure about HWPoison handling, that's why I added that
comment. In other regards I agree: reclaim etc. does not apply.
--
Cheers,
David / dhildenb