Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread John Hubbard
On 03/16/2018 08:47 PM, John Hubbard wrote: > On 03/16/2018 07:36 PM, John Hubbard wrote: >> On 03/16/2018 12:14 PM, jgli...@redhat.com wrote: >>> From: Ralph Campbell >>> >> >> >> >>> +static void hmm_release(struct mmu_notifier *mn, struct mm_struct *mm) >>> +{ >>> + struct hmm *hmm = mm->hmm

Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread John Hubbard
On 03/16/2018 07:36 PM, John Hubbard wrote: > On 03/16/2018 12:14 PM, jgli...@redhat.com wrote: >> From: Ralph Campbell >> > > > >> +static void hmm_release(struct mmu_notifier *mn, struct mm_struct *mm) >> +{ >> +struct hmm *hmm = mm->hmm; >> +struct hmm_mirror *mirror; >> +struct

Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread John Hubbard
On 03/16/2018 12:14 PM, jgli...@redhat.com wrote: > From: Ralph Campbell > > +static void hmm_release(struct mmu_notifier *mn, struct mm_struct *mm) > +{ > + struct hmm *hmm = mm->hmm; > + struct hmm_mirror *mirror; > + struct hmm_mirror *mirror_next; > + > + down_write(&hmm->m

Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread John Hubbard
On 03/16/2018 02:26 PM, Jerome Glisse wrote: > On Fri, Mar 16, 2018 at 02:12:21PM -0700, Andrew Morton wrote: >> On Fri, 16 Mar 2018 15:14:08 -0400 jgli...@redhat.com wrote: >> >>> The hmm_mirror_register() function registers a callback for when >>> the CPU pagetable is modified. Normally, the devi

Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread Jerome Glisse
On Fri, Mar 16, 2018 at 02:12:21PM -0700, Andrew Morton wrote: > On Fri, 16 Mar 2018 15:14:08 -0400 jgli...@redhat.com wrote: > > > The hmm_mirror_register() function registers a callback for when > > the CPU pagetable is modified. Normally, the device driver will > > call hmm_mirror_unregister()

Re: [PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread Andrew Morton
On Fri, 16 Mar 2018 15:14:08 -0400 jgli...@redhat.com wrote: > The hmm_mirror_register() function registers a callback for when > the CPU pagetable is modified. Normally, the device driver will > call hmm_mirror_unregister() when the process using the device is > finished. However, if the process

[PATCH 03/14] mm/hmm: HMM should have a callback before MM is destroyed v2

2018-03-16 Thread jglisse
From: Ralph Campbell The hmm_mirror_register() function registers a callback for when the CPU pagetable is modified. Normally, the device driver will call hmm_mirror_unregister() when the process using the device is finished. However, if the process exits uncleanly, the struct_mm can be destroyed