Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-18 Thread Kirti Wankhede
On 4/18/2017 8:24 AM, Peter Xu wrote: > On Mon, Apr 17, 2017 at 03:32:20PM -0600, Alex Williamson wrote: >> On Tue, 18 Apr 2017 01:02:12 +0530 >> Kirti Wankhede wrote: >> >>> On 4/18/2017 12:49 AM, Alex Williamson wrote: On Tue, 18 Apr 2017 00:35:06 +0530 Kirti

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-18 Thread Kirti Wankhede
On 4/18/2017 8:24 AM, Peter Xu wrote: > On Mon, Apr 17, 2017 at 03:32:20PM -0600, Alex Williamson wrote: >> On Tue, 18 Apr 2017 01:02:12 +0530 >> Kirti Wankhede wrote: >> >>> On 4/18/2017 12:49 AM, Alex Williamson wrote: On Tue, 18 Apr 2017 00:35:06 +0530 Kirti Wankhede wrote:

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Peter Xu
On Mon, Apr 17, 2017 at 03:32:20PM -0600, Alex Williamson wrote: > On Tue, 18 Apr 2017 01:02:12 +0530 > Kirti Wankhede wrote: > > > On 4/18/2017 12:49 AM, Alex Williamson wrote: > > > On Tue, 18 Apr 2017 00:35:06 +0530 > > > Kirti Wankhede wrote: > >

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Peter Xu
On Mon, Apr 17, 2017 at 03:32:20PM -0600, Alex Williamson wrote: > On Tue, 18 Apr 2017 01:02:12 +0530 > Kirti Wankhede wrote: > > > On 4/18/2017 12:49 AM, Alex Williamson wrote: > > > On Tue, 18 Apr 2017 00:35:06 +0530 > > > Kirti Wankhede wrote: > > > > > >> On 4/17/2017 8:02 PM, Alex

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Tue, 18 Apr 2017 01:02:12 +0530 Kirti Wankhede wrote: > On 4/18/2017 12:49 AM, Alex Williamson wrote: > > On Tue, 18 Apr 2017 00:35:06 +0530 > > Kirti Wankhede wrote: > > > >> On 4/17/2017 8:02 PM, Alex Williamson wrote: > >>> On Mon, 17 Apr

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Tue, 18 Apr 2017 01:02:12 +0530 Kirti Wankhede wrote: > On 4/18/2017 12:49 AM, Alex Williamson wrote: > > On Tue, 18 Apr 2017 00:35:06 +0530 > > Kirti Wankhede wrote: > > > >> On 4/17/2017 8:02 PM, Alex Williamson wrote: > >>> On Mon, 17 Apr 2017 14:47:54 +0800 > >>> Peter Xu wrote: >

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
On 4/18/2017 12:49 AM, Alex Williamson wrote: > On Tue, 18 Apr 2017 00:35:06 +0530 > Kirti Wankhede wrote: > >> On 4/17/2017 8:02 PM, Alex Williamson wrote: >>> On Mon, 17 Apr 2017 14:47:54 +0800 >>> Peter Xu wrote: >>> On Sun, Apr 16, 2017 at

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
On 4/18/2017 12:49 AM, Alex Williamson wrote: > On Tue, 18 Apr 2017 00:35:06 +0530 > Kirti Wankhede wrote: > >> On 4/17/2017 8:02 PM, Alex Williamson wrote: >>> On Mon, 17 Apr 2017 14:47:54 +0800 >>> Peter Xu wrote: >>> On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote:

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Tue, 18 Apr 2017 00:35:06 +0530 Kirti Wankhede wrote: > On 4/17/2017 8:02 PM, Alex Williamson wrote: > > On Mon, 17 Apr 2017 14:47:54 +0800 > > Peter Xu wrote: > > > >> On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: > >> > >>

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Tue, 18 Apr 2017 00:35:06 +0530 Kirti Wankhede wrote: > On 4/17/2017 8:02 PM, Alex Williamson wrote: > > On Mon, 17 Apr 2017 14:47:54 +0800 > > Peter Xu wrote: > > > >> On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: > >> > >> [...] > >> > >>> -static void

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
On 4/17/2017 8:02 PM, Alex Williamson wrote: > On Mon, 17 Apr 2017 14:47:54 +0800 > Peter Xu wrote: > >> On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: >> >> [...] >> >>> -static void vfio_lock_acct(struct task_struct *task, long npage) >>> +static int

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Kirti Wankhede
On 4/17/2017 8:02 PM, Alex Williamson wrote: > On Mon, 17 Apr 2017 14:47:54 +0800 > Peter Xu wrote: > >> On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: >> >> [...] >> >>> -static void vfio_lock_acct(struct task_struct *task, long npage) >>> +static int vfio_lock_acct(struct

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Mon, 17 Apr 2017 14:47:54 +0800 Peter Xu wrote: > On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: > > [...] > > > -static void vfio_lock_acct(struct task_struct *task, long npage) > > +static int vfio_lock_acct(struct task_struct *task, long npage, bool

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Alex Williamson
On Mon, 17 Apr 2017 14:47:54 +0800 Peter Xu wrote: > On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: > > [...] > > > -static void vfio_lock_acct(struct task_struct *task, long npage) > > +static int vfio_lock_acct(struct task_struct *task, long npage, bool > > lock_cap) > >

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Peter Xu
On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: [...] > -static void vfio_lock_acct(struct task_struct *task, long npage) > +static int vfio_lock_acct(struct task_struct *task, long npage, bool > lock_cap) > { > - struct vwork *vwork; > struct mm_struct *mm; >

Re: [PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-17 Thread Peter Xu
On Sun, Apr 16, 2017 at 07:42:27PM -0600, Alex Williamson wrote: [...] > -static void vfio_lock_acct(struct task_struct *task, long npage) > +static int vfio_lock_acct(struct task_struct *task, long npage, bool > lock_cap) > { > - struct vwork *vwork; > struct mm_struct *mm; >

[PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-16 Thread Alex Williamson
If the mmap_sem is contented then the vfio type1 IOMMU backend will defer locked page accounting updates to a workqueue task. This has a few problems and depending on which side the user tries to play, they might be over-penalized for unmaps that haven't yet been accounted or race the workqueue

[PATCH v4 1/2] vfio/type1: Remove locked page accounting workqueue

2017-04-16 Thread Alex Williamson
If the mmap_sem is contented then the vfio type1 IOMMU backend will defer locked page accounting updates to a workqueue task. This has a few problems and depending on which side the user tries to play, they might be over-penalized for unmaps that haven't yet been accounted or race the workqueue