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

2021-06-26 Thread Peter Xu
On Fri, Jun 11, 2021 at 01:43:20PM +1000, Alistair Popple wrote: > On Friday, 11 June 2021 11:00:34 AM AEST Peter Xu wrote: > > On Fri, Jun 11, 2021 at 09:17:14AM +1000, Alistair Popple wrote: > > > On Friday, 11 June 2021 9:04:19 AM AEST Peter Xu wrote: > > > > On Fri, Jun 11, 2021 at 12:21:26AM

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

2021-06-26 Thread Peter Xu
On Tue, Jun 15, 2021 at 01:08:11PM +1000, Alistair Popple wrote: > On Saturday, 12 June 2021 1:01:42 AM AEST Peter Xu wrote: > > On Fri, Jun 11, 2021 at 01:43:20PM +1000, Alistair Popple wrote: > > > On Friday, 11 June 2021 11:00:34 AM AEST Peter Xu wrote: > > > > On Fri, Jun 11, 2021 at

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

2021-06-26 Thread Peter Xu
On Fri, Jun 11, 2021 at 12:21:26AM +1000, Alistair Popple wrote: > > Hmm, the thing is.. to me FOLL_SPLIT_PMD should have similar effect to > > explicit > > call split_huge_pmd_address(), afaict. Since both of them use > > __split_huge_pmd() > > internally which will generate that unwanted

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

2021-06-26 Thread Peter Xu
On Fri, Jun 11, 2021 at 09:17:14AM +1000, Alistair Popple wrote: > On Friday, 11 June 2021 9:04:19 AM AEST Peter Xu wrote: > > External email: Use caution opening links or attachments > > > > > > On Fri, Jun 11, 2021 at 12:21:26AM +1000, Alistair Popple wrote: > > > > Hmm, the thing is.. to me

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

2021-06-26 Thread Peter Xu
On Thu, Jun 10, 2021 at 10:18:25AM +1000, Alistair Popple wrote: > > > The main problem is split_huge_pmd_address() unconditionally calls a mmu > > > notifier so I would need to plumb in passing an owner everywhere which > > > could > > > get messy. > > > > Could I ask why?

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

2021-06-15 Thread Alistair Popple
On Wednesday, 16 June 2021 2:25:09 AM AEST Peter Xu wrote: > On Tue, Jun 15, 2021 at 01:08:11PM +1000, Alistair Popple wrote: > > On Saturday, 12 June 2021 1:01:42 AM AEST Peter Xu wrote: > > > On Fri, Jun 11, 2021 at 01:43:20PM +1000, Alistair Popple wrote: [...] > > > Do you think we can

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

2021-06-14 Thread Alistair Popple
On Saturday, 12 June 2021 1:01:42 AM AEST Peter Xu wrote: > On Fri, Jun 11, 2021 at 01:43:20PM +1000, Alistair Popple wrote: > > On Friday, 11 June 2021 11:00:34 AM AEST Peter Xu wrote: > > > On Fri, Jun 11, 2021 at 09:17:14AM +1000, Alistair Popple wrote: > > > > On Friday, 11 June 2021 9:04:19

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

2021-06-10 Thread Alistair Popple
On Friday, 11 June 2021 11:00:34 AM AEST Peter Xu wrote: > On Fri, Jun 11, 2021 at 09:17:14AM +1000, Alistair Popple wrote: > > On Friday, 11 June 2021 9:04:19 AM AEST Peter Xu wrote: > > > On Fri, Jun 11, 2021 at 12:21:26AM +1000, Alistair Popple wrote: > > > > > Hmm, the thing is.. to me

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

2021-06-10 Thread Alistair Popple
On Friday, 11 June 2021 9:04:19 AM AEST Peter Xu wrote: > External email: Use caution opening links or attachments > > > On Fri, Jun 11, 2021 at 12:21:26AM +1000, Alistair Popple wrote: > > > Hmm, the thing is.. to me FOLL_SPLIT_PMD should have similar effect to > > > explicit > > > call

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

2021-06-10 Thread Alistair Popple
On Friday, 11 June 2021 4:04:35 AM AEST Peter Xu wrote: > External email: Use caution opening links or attachments > > > On Thu, Jun 10, 2021 at 10:18:25AM +1000, Alistair Popple wrote: > > > > The main problem is split_huge_pmd_address() unconditionally calls a mmu > > > > notifier so I would

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

2021-06-09 Thread Peter Xu
On Wed, Jun 09, 2021 at 07:38:04PM +1000, Alistair Popple wrote: > On Wednesday, 9 June 2021 4:33:52 AM AEST Peter Xu wrote: > > On Mon, Jun 07, 2021 at 05:58:52PM +1000, Alistair Popple wrote: > > > > [...] > > > > > +static bool page_make_device_exclusive_one(struct page *page, > > > +

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

2021-06-09 Thread Alistair Popple
On Thursday, 10 June 2021 2:05:06 AM AEST Peter Xu wrote: > On Wed, Jun 09, 2021 at 07:38:04PM +1000, Alistair Popple wrote: > > On Wednesday, 9 June 2021 4:33:52 AM AEST Peter Xu wrote: > > > On Mon, Jun 07, 2021 at 05:58:52PM +1000, Alistair Popple wrote: [...] > > For thp this means we could

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

2021-06-09 Thread Alistair Popple
On Wednesday, 9 June 2021 4:33:52 AM AEST Peter Xu wrote: > On Mon, Jun 07, 2021 at 05:58:52PM +1000, Alistair Popple wrote: > > [...] > > > +static bool page_make_device_exclusive_one(struct page *page, > > + struct vm_area_struct *vma, unsigned long address, void *priv) > > +{ > >

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

2021-06-08 Thread Peter Xu
On Mon, Jun 07, 2021 at 05:58:52PM +1000, Alistair Popple wrote: [...] > +static bool page_make_device_exclusive_one(struct page *page, > + struct vm_area_struct *vma, unsigned long address, void *priv) > +{ > + struct mm_struct *mm = vma->vm_mm; > + struct

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

2021-06-07 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