Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-04 Thread Peter Xu
On Fri, Jun 04, 2021 at 11:07:42AM +1000, Alistair Popple wrote: > On Friday, 4 June 2021 12:47:40 AM AEST Peter Xu wrote: > > External email: Use caution opening links or attachments > > > > On Thu, Jun 03, 2021 at 09:39:32PM +1000, Alistair Popple wrote: > > > Reclaim won't run on the page due t

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-03 Thread Alistair Popple
On Friday, 4 June 2021 12:47:40 AM AEST Peter Xu wrote: > External email: Use caution opening links or attachments > > On Thu, Jun 03, 2021 at 09:39:32PM +1000, Alistair Popple wrote: > > Reclaim won't run on the page due to the extra references from the special > > swap entries. > > That sounds

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-03 Thread Peter Xu
On Thu, Jun 03, 2021 at 09:39:32PM +1000, Alistair Popple wrote: > Reclaim won't run on the page due to the extra references from the special > swap entries. That sounds reasonable, but I didn't find the point that stops it, probably due to my limited knowledge on the reclaim code. Could you ela

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-03 Thread Alistair Popple
On Thursday, 3 June 2021 12:37:30 AM AEST Peter Xu wrote: > External email: Use caution opening links or attachments > > On Wed, Jun 02, 2021 at 06:50:37PM +1000, Balbir Singh wrote: > > On Wed, May 26, 2021 at 12:17:18AM -0700, John Hubbard wrote: > > > On 5/25/21 4:51 AM, Balbir Singh wrote: > >

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-03 Thread John Hubbard
On 6/2/21 1:50 AM, Balbir Singh wrote: ... only impact the address space of programs using the GPU. Should the exclusively marked range live in the unreclaimable list and recycled back to active/in-active to account for the fact that 1. It is not reclaimable and reclaim will only hurt via page

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-02 Thread Peter Xu
On Wed, Jun 02, 2021 at 06:50:37PM +1000, Balbir Singh wrote: > On Wed, May 26, 2021 at 12:17:18AM -0700, John Hubbard wrote: > > On 5/25/21 4:51 AM, Balbir Singh wrote: > > ... > > > > How beneficial is this code to nouveau users? I see that it permits a > > > > part of OpenCL to be implemented,

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-06-02 Thread Balbir Singh
On Wed, May 26, 2021 at 12:17:18AM -0700, John Hubbard wrote: > On 5/25/21 4:51 AM, Balbir Singh wrote: > ... > > > How beneficial is this code to nouveau users? I see that it permits a > > > part of OpenCL to be implemented, but how useful/important is this in > > > the real world? > > > > That

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-28 Thread Peter Xu
On Fri, May 28, 2021 at 11:48:40AM +1000, Alistair Popple wrote: [...] > > > > > + while (page_vma_mapped_walk(&pvmw)) { > > > > > + /* Unexpected PMD-mapped THP? */ > > > > > + VM_BUG_ON_PAGE(!pvmw.pte, page); > > > > > + > > > > > + if (!pte_present(*pvmw

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-27 Thread Alistair Popple
On Thursday, 27 May 2021 11:04:57 PM AEST Peter Xu wrote: > On Thu, May 27, 2021 at 01:35:39PM +1000, Alistair Popple wrote: > > > > + * > > > > + * @MMU_NOTIFY_EXCLUSIVE: to signal a device driver that the device > > > > will > > > > no + * longer have exclusive access to the page. May ignore the

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-27 Thread Peter Xu
On Thu, May 27, 2021 at 01:35:39PM +1000, Alistair Popple wrote: > > > + * > > > + * @MMU_NOTIFY_EXCLUSIVE: to signal a device driver that the device will > > > no + * longer have exclusive access to the page. May ignore the > > > invalidation that's + * part of make_device_exclusive_range() if the

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-26 Thread Alistair Popple
On Thursday, 27 May 2021 5:28:32 AM AEST Peter Xu wrote: > On Mon, May 24, 2021 at 11:27:22PM +1000, 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

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-26 Thread Peter Xu
On Mon, May 24, 2021 at 11:27:22PM +1000, 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.

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-26 Thread Alistair Popple
On Wednesday, 26 May 2021 5:17:18 PM AEST John Hubbard wrote: > On 5/25/21 4:51 AM, Balbir Singh wrote: > ... > > >> How beneficial is this code to nouveau users? I see that it permits a > >> part of OpenCL to be implemented, but how useful/important is this in > >> the real world? > > > > That

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-26 Thread John Hubbard
On 5/25/21 4:51 AM, Balbir Singh wrote: ... How beneficial is this code to nouveau users? I see that it permits a part of OpenCL to be implemented, but how useful/important is this in the real world? That is a very good question! I've not reviewed the code, but a sample program with the descri

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-25 Thread Balbir Singh
On Mon, May 24, 2021 at 03:11:57PM -0700, Andrew Morton wrote: > On Mon, 24 May 2021 23:27:22 +1000 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

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-25 Thread Alistair Popple
On Tuesday, 25 May 2021 11:31:17 AM AEST John Hubbard wrote: > On 5/24/21 3:11 PM, Andrew Morton wrote: > >> ... > >> > >> Documentation/vm/hmm.rst | 17 > >> include/linux/mmu_notifier.h | 6 ++ > >> include/linux/rmap.h | 4 + > >> include/linux/swap.h | 7 +-

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-24 Thread John Hubbard
On 5/24/21 3:11 PM, Andrew Morton wrote: ... Documentation/vm/hmm.rst | 17 include/linux/mmu_notifier.h | 6 ++ include/linux/rmap.h | 4 + include/linux/swap.h | 7 +- include/linux/swapops.h | 44 - mm/hmm.c | 5 + mm

Re: [PATCH v9 07/10] mm: Device exclusive memory access

2021-05-24 Thread Andrew Morton
On Mon, 24 May 2021 23:27:22 +1000 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. > >

[PATCH v9 07/10] mm: Device exclusive memory access

2021-05-24 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 (SWP_DEVICE_EXCLUSIV