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

2021-03-03 Thread Alistair Popple
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

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

2021-03-02 Thread Jason Gunthorpe
On Tue, Mar 02, 2021 at 07:57:58PM +1100, Alistair Popple wrote: > The intent was a driver could use HMM or some other mechanism to keep PTEs > synchronised if required. However I just looked at patch 8 in the series > again > and it appears I got this wrong when converting from the old

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

2021-03-02 Thread Alistair Popple
On Tuesday, 2 March 2021 11:05:59 AM AEDT Jason Gunthorpe wrote: > On Fri, Feb 26, 2021 at 06:18:29PM +1100, Alistair Popple wrote: > > > +/** > > + * make_device_exclusive_range() - Mark a range for exclusive use by a device > > + * @mm: mm_struct of assoicated target process > > + * @start:

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

2021-03-01 Thread Jason Gunthorpe
On Fri, Feb 26, 2021 at 06:18:29PM +1100, Alistair Popple wrote: > +/** > + * make_device_exclusive_range() - Mark a range for exclusive use by a device > + * @mm: mm_struct of assoicated target process > + * @start: start of the region to mark for exclusive device access > + * @end: end address

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

2021-03-01 Thread Ralph Campbell
> From: Alistair Popple > Sent: Thursday, February 25, 2021 11:18 PM > To: linux...@kvack.org; nouveau@lists.freedesktop.org; > bske...@redhat.com; a...@linux-foundation.org > Cc: linux-...@vger.kernel.org; linux-ker...@vger.kernel.org; dri- > de...@lists.freedesktop.org; John Hubbard ; Ralph >

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

2021-03-01 Thread Jason Gunthorpe
On Fri, Feb 26, 2021 at 06:18:29PM +1100, Alistair Popple wrote: > Some devices require exclusive write access to shared virtual > memory (SVM) ranges to perform atomic operations on that memory. This > requires CPU page tables to be updated to deny access whilst atomic > operations are occurring.

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

2021-02-25 Thread Alistair Popple
Some devices require exclusive write access to shared virtual memory (SVM) ranges to perform atomic operations on that memory. This requires CPU page tables to be updated to deny access whilst atomic operations are occurring. In order to do this introduce a new swap entry type