Re: [PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-11-08 Thread David Gibson
On Tue, Nov 08, 2016 at 03:25:19PM -0700, Alex Williamson wrote: > On Mon, 24 Oct 2016 17:53:09 +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

Re: [PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-11-08 Thread Alex Williamson
On Mon, 24 Oct 2016 17:53:09 +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 have tce_container take a reference to mm_struct and > use it later w

Re: [PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-11-07 Thread David Gibson
On Mon, Oct 24, 2016 at 05:53:09PM +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 have tce_container take a reference to mm_struct and > use it la

Re: [PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-10-24 Thread Nicholas Piggin
On Mon, 24 Oct 2016 17:53:09 +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 have tce_container take a reference to mm_struct and > use it later w

[PATCH kernel v4 3/4] vfio/spapr: Reference mm in tce_container

2016-10-23 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 have tce_container take a reference to mm_struct and use it later when the process is gone (@current or @current->mm is NULL). This referen