Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-17 Thread Jason Gunthorpe
On Mon, Mar 16, 2020 at 08:46:59AM -0700, Christoph Hellwig wrote: > On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > > This is why release must do invalidate all - but it doesn't need to do > > any more - as no SPTE can be established without a mmget() - and > > mmget() is no

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-16 Thread Christoph Hellwig
On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > This is why release must do invalidate all - but it doesn't need to do > any more - as no SPTE can be established without a mmget() - and > mmget() is no longer possible past release. Maybe we should rename the release method to

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-13 Thread Jason Gunthorpe
On Fri, Mar 13, 2020 at 07:49:29PM +0100, Jean-Philippe Brucker wrote: > On Fri, Mar 06, 2020 at 01:42:39PM -0400, Jason Gunthorpe wrote: > > On Fri, Mar 06, 2020 at 05:15:19PM +0100, Jean-Philippe Brucker wrote: > > > On Fri, Mar 06, 2020 at 10:52:45AM -0400, Jason Gunthorpe wrote: > > > > On

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-13 Thread Jean-Philippe Brucker
On Fri, Mar 06, 2020 at 01:42:39PM -0400, Jason Gunthorpe wrote: > On Fri, Mar 06, 2020 at 05:15:19PM +0100, Jean-Philippe Brucker wrote: > > On Fri, Mar 06, 2020 at 10:52:45AM -0400, Jason Gunthorpe wrote: > > > On Fri, Mar 06, 2020 at 03:35:56PM +0100, Jean-Philippe Brucker wrote: > > > > On

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jason Gunthorpe
On Fri, Mar 06, 2020 at 05:15:19PM +0100, Jean-Philippe Brucker wrote: > On Fri, Mar 06, 2020 at 10:52:45AM -0400, Jason Gunthorpe wrote: > > On Fri, Mar 06, 2020 at 03:35:56PM +0100, Jean-Philippe Brucker wrote: > > > On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > > > > On

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jean-Philippe Brucker
On Fri, Mar 06, 2020 at 10:52:45AM -0400, Jason Gunthorpe wrote: > On Fri, Mar 06, 2020 at 03:35:56PM +0100, Jean-Philippe Brucker wrote: > > On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > > > On Fri, Mar 06, 2020 at 10:56:14AM +0100, Jean-Philippe Brucker wrote: > > > > I

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jason Gunthorpe
On Fri, Mar 06, 2020 at 03:35:56PM +0100, Jean-Philippe Brucker wrote: > On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > > On Fri, Mar 06, 2020 at 10:56:14AM +0100, Jean-Philippe Brucker wrote: > > > I tried to keep it simple like that: normally mmu_notifier_get() is called > >

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jean-Philippe Brucker
On Fri, Mar 06, 2020 at 09:09:19AM -0400, Jason Gunthorpe wrote: > On Fri, Mar 06, 2020 at 10:56:14AM +0100, Jean-Philippe Brucker wrote: > > I tried to keep it simple like that: normally mmu_notifier_get() is called > > in bind(), and mmu_notifier_put() is called in unbind(). > > > > Multiple

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jason Gunthorpe
On Fri, Mar 06, 2020 at 10:56:14AM +0100, Jean-Philippe Brucker wrote: > I tried to keep it simple like that: normally mmu_notifier_get() is called > in bind(), and mmu_notifier_put() is called in unbind(). > > Multiple device drivers may call bind() with the same mm. Each bind() > calls

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-06 Thread Jean-Philippe Brucker
On Fri, Feb 28, 2020 at 11:13:40AM -0400, Jason Gunthorpe wrote: > On Fri, Feb 28, 2020 at 04:04:27PM +0100, Jean-Philippe Brucker wrote: > > On Fri, Feb 28, 2020 at 10:48:44AM -0400, Jason Gunthorpe wrote: > > > On Fri, Feb 28, 2020 at 03:39:35PM +0100, Jean-Philippe Brucker wrote: > > > > > > +

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-03-05 Thread Christoph Hellwig
On Mon, Feb 24, 2020 at 07:23:36PM +0100, Jean-Philippe Brucker wrote: > -static struct mmu_notifier *gru_alloc_notifier(struct mm_struct *mm) > +static struct mmu_notifier *gru_alloc_notifier(struct mm_struct *mm, void > *privdata) Pleae don't introduce any > 80 char lines. Not here, and not

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-28 Thread Jason Gunthorpe
On Fri, Feb 28, 2020 at 04:04:27PM +0100, Jean-Philippe Brucker wrote: > On Fri, Feb 28, 2020 at 10:48:44AM -0400, Jason Gunthorpe wrote: > > On Fri, Feb 28, 2020 at 03:39:35PM +0100, Jean-Philippe Brucker wrote: > > > > > + list_for_each_entry_rcu(bond, _mm->devices, mm_head) { > > > > > +

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-28 Thread Jean-Philippe Brucker
On Fri, Feb 28, 2020 at 10:48:44AM -0400, Jason Gunthorpe wrote: > On Fri, Feb 28, 2020 at 03:39:35PM +0100, Jean-Philippe Brucker wrote: > > > > + list_for_each_entry_rcu(bond, _mm->devices, mm_head) { > > > > + /* > > > > +* To ensure that we observe the

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-28 Thread Jason Gunthorpe
On Fri, Feb 28, 2020 at 03:39:35PM +0100, Jean-Philippe Brucker wrote: > > > + list_for_each_entry_rcu(bond, _mm->devices, mm_head) { > > > + /* > > > + * To ensure that we observe the initialization of io_mm fields > > > + * by io_mm_finalize() before the registration of

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-28 Thread Jean-Philippe Brucker
On Tue, Feb 25, 2020 at 10:08:14AM -0400, Jason Gunthorpe wrote: > On Tue, Feb 25, 2020 at 10:24:39AM +0100, Jean-Philippe Brucker wrote: > > On Mon, Feb 24, 2020 at 03:00:56PM -0400, Jason Gunthorpe wrote: > > > On Mon, Feb 24, 2020 at 07:23:36PM +0100, Jean-Philippe Brucker wrote: > > > > The

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-25 Thread Jason Gunthorpe
On Tue, Feb 25, 2020 at 10:24:39AM +0100, Jean-Philippe Brucker wrote: > On Mon, Feb 24, 2020 at 03:00:56PM -0400, Jason Gunthorpe wrote: > > On Mon, Feb 24, 2020 at 07:23:36PM +0100, Jean-Philippe Brucker wrote: > > > The new allocation scheme introduced by 2c7933f53f6b ("mm/mmu_notifiers: > > >

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-25 Thread Jean-Philippe Brucker
On Mon, Feb 24, 2020 at 03:00:56PM -0400, Jason Gunthorpe wrote: > On Mon, Feb 24, 2020 at 07:23:36PM +0100, Jean-Philippe Brucker wrote: > > The new allocation scheme introduced by 2c7933f53f6b ("mm/mmu_notifiers: > > add a get/put scheme for the registration") provides a convenient way > > for

Re: [PATCH v4 01/26] mm/mmu_notifiers: pass private data down to alloc_notifier()

2020-02-24 Thread Jason Gunthorpe
On Mon, Feb 24, 2020 at 07:23:36PM +0100, Jean-Philippe Brucker wrote: > The new allocation scheme introduced by 2c7933f53f6b ("mm/mmu_notifiers: > add a get/put scheme for the registration") provides a convenient way > for users to attach notifier data to an mm. However, it would be even > better