Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-23 Thread Nicholas Piggin
On Mon, 24 Oct 2016 15:25:34 +1100 Alexey Kardashevskiy wrote: > On 20/10/16 18:31, Nicholas Piggin wrote: > > On Thu, 20 Oct 2016 14:03:49 +1100 > > Alexey Kardashevskiy wrote: > > > >> In some situations the userspace memory context may live longer than > >>

Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-23 Thread Alexey Kardashevskiy
On 20/10/16 18:31, Nicholas Piggin wrote: > On Thu, 20 Oct 2016 14:03:49 +1100 > Alexey Kardashevskiy wrote: > >> In some situations the userspace memory context may live longer than >> the userspace process itself so if we need to do proper memory context >> cleanup, we better

Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-20 Thread Nicholas Piggin
On Fri, 21 Oct 2016 11:21:34 +1100 David Gibson wrote: > On Thu, Oct 20, 2016 at 06:31:21PM +1100, Nicholas Piggin wrote: > > On Thu, 20 Oct 2016 14:03:49 +1100 > > Alexey Kardashevskiy wrote: > > > > > In some situations the userspace memory

Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-20 Thread David Gibson
On Thu, Oct 20, 2016 at 02:03:49PM +1100, Alexey Kardashevskiy wrote: > In some situations the userspace memory context may live longer than > the userspace process itself so if we need to do proper memory context > cleanup, we better cache @mm and use it later when the process is gone > (@current

Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-20 Thread David Gibson
On Thu, Oct 20, 2016 at 06:31:21PM +1100, Nicholas Piggin wrote: > On Thu, 20 Oct 2016 14:03:49 +1100 > Alexey Kardashevskiy wrote: > > > In some situations the userspace memory context may live longer than > > the userspace process itself so if we need to do proper memory

Re: [PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-20 Thread Nicholas Piggin
On Thu, 20 Oct 2016 14:03:49 +1100 Alexey Kardashevskiy wrote: > In some situations the userspace memory context may live longer than > the userspace process itself so if we need to do proper memory context > cleanup, we better cache @mm and use it later when the process is gone

[PATCH kernel v3 3/4] vfio/spapr: Cache mm in tce_container

2016-10-19 Thread Alexey Kardashevskiy
In some situations the userspace memory context may live longer than the userspace process itself so if we need to do proper memory context cleanup, we better cache @mm and use it later when the process is gone (@current or @current->mm is NULL). This references mm and stores the pointer in the