Re: [Nouveau] [PATCH 01/10] mm: turn migrate_vma upside down

2019-08-17 Thread Jason Gunthorpe
On Sat, Aug 17, 2019 at 01:31:28PM +0200, Christoph Hellwig wrote: > On Fri, Aug 16, 2019 at 05:11:07PM +, Jason Gunthorpe wrote: > > - if (args->cpages) > > - migrate_vma_prepare(args); > > - if (args->cpages) > > - migrate_vma_unmap(args); > > + if (!args->cpages) >

Re: [PATCH 01/10] mm: turn migrate_vma upside down

2019-08-17 Thread Christoph Hellwig
On Fri, Aug 16, 2019 at 05:11:07PM +, Jason Gunthorpe wrote: > - if (args->cpages) > - migrate_vma_prepare(args); > - if (args->cpages) > - migrate_vma_unmap(args); > + if (!args->cpages) > + return 0; > + > + migrate_vma_prepare(args); > +

Re: [PATCH 01/10] mm: turn migrate_vma upside down

2019-08-16 Thread Jason Gunthorpe
On Wed, Aug 14, 2019 at 09:59:19AM +0200, Christoph Hellwig wrote: > There isn't any good reason to pass callbacks to migrate_vma. Instead > we can just export the three steps done by this function to drivers and > let them sequence the operation without callbacks. This removes a lot > of

Re: [Nouveau] [PATCH 01/10] mm: turn migrate_vma upside down

2019-08-14 Thread William Lewis
On 8/14/19 2:59 AM, Christoph Hellwig wrote: > There isn't any good reason to pass callbacks to migrate_vma. Instead > we can just export the three steps done by this function to drivers and > let them sequence the operation without callbacks. This removes a lot > of boilerplate code as-is, and

[Nouveau] [PATCH 01/10] mm: turn migrate_vma upside down

2019-08-14 Thread Christoph Hellwig
There isn't any good reason to pass callbacks to migrate_vma. Instead we can just export the three steps done by this function to drivers and let them sequence the operation without callbacks. This removes a lot of boilerplate code as-is, and will allow the drivers to drastically improve code