Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-20 Thread Jerome Glisse
On Mon, Nov 21, 2016 at 02:30:46PM +1100, Balbir Singh wrote: > On 19/11/16 05:18, Jérôme Glisse wrote: [...] > > + > > + > > +#if defined(CONFIG_HMM) > > +struct hmm_migrate { > > + struct vm_area_struct *vma; > > + unsigned long start; > > + unsigned long end; > > +

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-20 Thread Balbir Singh
On 19/11/16 05:18, Jérôme Glisse wrote: > This patch add a new memory migration helpers, which migrate memory adds helper migrates > backing a range of virtual address of a process to different memory > (which can be allocated through special allocator).

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-20 Thread Jerome Glisse
On Sun, Nov 20, 2016 at 11:51:48PM +0530, Aneesh Kumar K.V wrote: > Jerome Glisse writes: > > . > > >> > + > >> > +*pfns = hmm_pfn_from_pfn(pfn) | HMM_PFN_MIGRATE | flags; > >> > +*pfns |= write ? HMM_PFN_WRITE : 0; > >> > +migrate->npages++; >

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-20 Thread Aneesh Kumar K.V
Jerome Glisse writes: . >> > + >> > + *pfns = hmm_pfn_from_pfn(pfn) | HMM_PFN_MIGRATE | flags; >> > + *pfns |= write ? HMM_PFN_WRITE : 0; >> > + migrate->npages++; >> > + get_page(page); >> > + >> > + if (!trylock_page(page)) { >> > +

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-19 Thread Jerome Glisse
On Sat, Nov 19, 2016 at 08:02:26PM +0530, Aneesh Kumar K.V wrote: > Jérôme Glisse writes: > > > This patch add a new memory migration helpers, which migrate memory > > backing a range of virtual address of a process to different memory > > (which can be allocated through special allocator). It di

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-19 Thread Aneesh Kumar K.V
Jérôme Glisse writes: > This patch add a new memory migration helpers, which migrate memory > backing a range of virtual address of a process to different memory > (which can be allocated through special allocator). It differs from > numa migration by working on a range of virtual address and thu

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-18 Thread Jerome Glisse
On Sat, Nov 19, 2016 at 01:27:28AM +0530, Aneesh Kumar K.V wrote: > Jérôme Glisse writes: > > > [...] > > >+ > > +static int hmm_collect_walk_pmd(pmd_t *pmdp, > > + unsigned long start, > > + unsigned long end, > > + s

Re: [HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-18 Thread Aneesh Kumar K.V
Jérôme Glisse writes: > This patch add a new memory migration helpers, which migrate memory > backing a range of virtual address of a process to different memory > (which can be allocated through special allocator). It differs from > numa migration by working on a range of virtual address and thu

[HMM v13 16/18] mm/hmm/migrate: new memory migration helper for use with device memory

2016-11-18 Thread Jérôme Glisse
This patch add a new memory migration helpers, which migrate memory backing a range of virtual address of a process to different memory (which can be allocated through special allocator). It differs from numa migration by working on a range of virtual address and thus by doing migration in chunk th