Re: [PATCH v3 5/8] mm: Device exclusive memory access

From: Alistair Popple
Date: Thu Mar 04 2021 - 00:22:30 EST


On Tuesday, 2 March 2021 11:41:52 PM AEDT Jason Gunthorpe wrote:
> > However try_to_protect() scans the PTEs again under the PTL so checking
the
> > mapping of interest actually gets replaced during the rmap walk seems like
a
> > reasonable solution. Thanks for the comments.
>
> It does seem cleaner if you can manage it, the notifier will still be
> needd to program the HW though

Checking during the rmap walk wasn't hard but ultimately pointless. As you say
a range notifier and lock is required to program the hardware, which requires
checking the mappings with a mmu notifier sequence anyway.

- Alistair