All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL] vhost: infrastructure changes for 3.16
@ 2014-06-11 13:44 ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-11 13:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: nab, linux-kernel, kvm, virtualization, netdev, sfr, linux-scsi

Hi Linus,
Please pull the following.
Please note this needs to be merged before merging
target-pending PULL which Nicholas will be sending
out shortly.

Thanks!

The following changes since commit 1860e379875dfe7271c649058aeddffe5afd9d0d:

  Linux 3.15 (2014-06-08 11:19:54 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus

for you to fetch changes up to 47283bef7ed356629467d1fac61687756e48f254:

  vhost: move memory pointer to VQs (2014-06-09 16:21:07 +0300)

----------------------------------------------------------------
vhost: infrastructure changes for 3.16

This reworks vhost core dropping unnecessary RCU uses in favor of VQ mutexes
which are used on fast path anyway.  This fixes worst-case latency for users
which change the memory mappings a lot.
Memory allocation for vhost-net now supports fallback on vmalloc (same as for
vhost-scsi) this makes it possible to create the device on systems where memory
is very fragmented, with slightly lower performance.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Michael S. Tsirkin (4):
      vhost-net: extend device allocation to vmalloc
      vhost: replace rcu with mutex
      vhost: move acked_features to VQs
      vhost: move memory pointer to VQs

 drivers/vhost/vhost.h | 19 ++++------
 drivers/vhost/net.c   | 35 ++++++++++++-------
 drivers/vhost/scsi.c  | 26 ++++++++------
 drivers/vhost/test.c  | 11 +++---
 drivers/vhost/vhost.c | 97 ++++++++++++++++++++++++++-------------------------
 5 files changed, 101 insertions(+), 87 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PULL] vhost: infrastructure changes for 3.16
@ 2014-06-11 13:44 ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-11 13:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: sfr, linux-scsi, kvm, netdev, linux-kernel, virtualization, nab

Hi Linus,
Please pull the following.
Please note this needs to be merged before merging
target-pending PULL which Nicholas will be sending
out shortly.

Thanks!

The following changes since commit 1860e379875dfe7271c649058aeddffe5afd9d0d:

  Linux 3.15 (2014-06-08 11:19:54 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus

for you to fetch changes up to 47283bef7ed356629467d1fac61687756e48f254:

  vhost: move memory pointer to VQs (2014-06-09 16:21:07 +0300)

----------------------------------------------------------------
vhost: infrastructure changes for 3.16

This reworks vhost core dropping unnecessary RCU uses in favor of VQ mutexes
which are used on fast path anyway.  This fixes worst-case latency for users
which change the memory mappings a lot.
Memory allocation for vhost-net now supports fallback on vmalloc (same as for
vhost-scsi) this makes it possible to create the device on systems where memory
is very fragmented, with slightly lower performance.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Michael S. Tsirkin (4):
      vhost-net: extend device allocation to vmalloc
      vhost: replace rcu with mutex
      vhost: move acked_features to VQs
      vhost: move memory pointer to VQs

 drivers/vhost/vhost.h | 19 ++++------
 drivers/vhost/net.c   | 35 ++++++++++++-------
 drivers/vhost/scsi.c  | 26 ++++++++------
 drivers/vhost/test.c  | 11 +++---
 drivers/vhost/vhost.c | 97 ++++++++++++++++++++++++++-------------------------
 5 files changed, 101 insertions(+), 87 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PULL] vhost: infrastructure changes for 3.16
  2014-06-11 13:44 ` Michael S. Tsirkin
@ 2014-06-12  8:42   ` Romain Francoise
  -1 siblings, 0 replies; 6+ messages in thread
From: Romain Francoise @ 2014-06-12  8:42 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Linus Torvalds, nab, linux-kernel, kvm, virtualization, netdev,
	sfr, linux-scsi, Al Viro

"Michael S. Tsirkin" <mst@redhat.com> writes:

> Memory allocation for vhost-net now supports fallback on vmalloc (same
> as for vhost-scsi) this makes it possible to create the device on
> systems where memory is very fragmented, with slightly lower
> performance.

Thanks Michael, I'm glad to see that this change made its way into
mainline after all! Would you be willing to take the following on top?


From: Romain Francoise <romain@orebokech.com>
Date: Thu, 12 Jun 2014 10:26:40 +0200
Subject: [PATCH] vhost-net: don't open-code kvfree

Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc")
added another open-coded version of kvfree (which is available since
v3.15-rc5), nuke it.

Signed-off-by: Romain Francoise <romain@orebokech.com>
---
 drivers/vhost/net.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 971a760..8dae2f7 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work)
 	handle_rx(net);
 }
 
-static void vhost_net_free(void *addr)
-{
-	if (is_vmalloc_addr(addr))
-		vfree(addr);
-	else
-		kfree(addr);
-}
-
 static int vhost_net_open(struct inode *inode, struct file *f)
 {
 	struct vhost_net *n;
@@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
 	}
 	vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
 	if (!vqs) {
-		vhost_net_free(n);
+		kvfree(n);
 		return -ENOMEM;
 	}
 
@@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
 	 * since jobs can re-queue themselves. */
 	vhost_net_flush(n);
 	kfree(n->dev.vqs);
-	vhost_net_free(n);
+	kvfree(n);
 	return 0;
 }
 
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PULL] vhost: infrastructure changes for 3.16
@ 2014-06-12  8:42   ` Romain Francoise
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Francoise @ 2014-06-12  8:42 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: sfr, linux-scsi, kvm, netdev, linux-kernel, virtualization,
	Al Viro, nab, Linus Torvalds

"Michael S. Tsirkin" <mst@redhat.com> writes:

> Memory allocation for vhost-net now supports fallback on vmalloc (same
> as for vhost-scsi) this makes it possible to create the device on
> systems where memory is very fragmented, with slightly lower
> performance.

Thanks Michael, I'm glad to see that this change made its way into
mainline after all! Would you be willing to take the following on top?


From: Romain Francoise <romain@orebokech.com>
Date: Thu, 12 Jun 2014 10:26:40 +0200
Subject: [PATCH] vhost-net: don't open-code kvfree

Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc")
added another open-coded version of kvfree (which is available since
v3.15-rc5), nuke it.

Signed-off-by: Romain Francoise <romain@orebokech.com>
---
 drivers/vhost/net.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 971a760..8dae2f7 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work)
 	handle_rx(net);
 }
 
-static void vhost_net_free(void *addr)
-{
-	if (is_vmalloc_addr(addr))
-		vfree(addr);
-	else
-		kfree(addr);
-}
-
 static int vhost_net_open(struct inode *inode, struct file *f)
 {
 	struct vhost_net *n;
@@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
 	}
 	vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
 	if (!vqs) {
-		vhost_net_free(n);
+		kvfree(n);
 		return -ENOMEM;
 	}
 
@@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
 	 * since jobs can re-queue themselves. */
 	vhost_net_flush(n);
 	kfree(n->dev.vqs);
-	vhost_net_free(n);
+	kvfree(n);
 	return 0;
 }
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PULL] vhost: infrastructure changes for 3.16
  2014-06-12  8:42   ` Romain Francoise
@ 2014-06-12  9:39     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-12  9:39 UTC (permalink / raw)
  To: Romain Francoise
  Cc: Linus Torvalds, nab, linux-kernel, kvm, virtualization, netdev,
	sfr, linux-scsi, Al Viro

On Thu, Jun 12, 2014 at 10:42:34AM +0200, Romain Francoise wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > Memory allocation for vhost-net now supports fallback on vmalloc (same
> > as for vhost-scsi) this makes it possible to create the device on
> > systems where memory is very fragmented, with slightly lower
> > performance.
> 
> Thanks Michael, I'm glad to see that this change made its way into
> mainline after all! Would you be willing to take the following on top?
> 
> 
> From: Romain Francoise <romain@orebokech.com>
> Date: Thu, 12 Jun 2014 10:26:40 +0200
> Subject: [PATCH] vhost-net: don't open-code kvfree
> 
> Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc")
> added another open-coded version of kvfree (which is available since
> v3.15-rc5), nuke it.
> 
> Signed-off-by: Romain Francoise <romain@orebokech.com>
> ---

Absolutely, I'll queue this up, thanks!

>  drivers/vhost/net.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 971a760..8dae2f7 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work)
>  	handle_rx(net);
>  }
>  
> -static void vhost_net_free(void *addr)
> -{
> -	if (is_vmalloc_addr(addr))
> -		vfree(addr);
> -	else
> -		kfree(addr);
> -}
> -
>  static int vhost_net_open(struct inode *inode, struct file *f)
>  {
>  	struct vhost_net *n;
> @@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
>  	}
>  	vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
>  	if (!vqs) {
> -		vhost_net_free(n);
> +		kvfree(n);
>  		return -ENOMEM;
>  	}
>  
> @@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
>  	 * since jobs can re-queue themselves. */
>  	vhost_net_flush(n);
>  	kfree(n->dev.vqs);
> -	vhost_net_free(n);
> +	kvfree(n);
>  	return 0;
>  }
>  
> -- 
> 2.0.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PULL] vhost: infrastructure changes for 3.16
@ 2014-06-12  9:39     ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-12  9:39 UTC (permalink / raw)
  To: Romain Francoise
  Cc: sfr, linux-scsi, kvm, netdev, linux-kernel, virtualization,
	Al Viro, nab, Linus Torvalds

On Thu, Jun 12, 2014 at 10:42:34AM +0200, Romain Francoise wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > Memory allocation for vhost-net now supports fallback on vmalloc (same
> > as for vhost-scsi) this makes it possible to create the device on
> > systems where memory is very fragmented, with slightly lower
> > performance.
> 
> Thanks Michael, I'm glad to see that this change made its way into
> mainline after all! Would you be willing to take the following on top?
> 
> 
> From: Romain Francoise <romain@orebokech.com>
> Date: Thu, 12 Jun 2014 10:26:40 +0200
> Subject: [PATCH] vhost-net: don't open-code kvfree
> 
> Commit 23cc5a991c ("vhost-net: extend device allocation to vmalloc")
> added another open-coded version of kvfree (which is available since
> v3.15-rc5), nuke it.
> 
> Signed-off-by: Romain Francoise <romain@orebokech.com>
> ---

Absolutely, I'll queue this up, thanks!

>  drivers/vhost/net.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 971a760..8dae2f7 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -700,14 +700,6 @@ static void handle_rx_net(struct vhost_work *work)
>  	handle_rx(net);
>  }
>  
> -static void vhost_net_free(void *addr)
> -{
> -	if (is_vmalloc_addr(addr))
> -		vfree(addr);
> -	else
> -		kfree(addr);
> -}
> -
>  static int vhost_net_open(struct inode *inode, struct file *f)
>  {
>  	struct vhost_net *n;
> @@ -723,7 +715,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
>  	}
>  	vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL);
>  	if (!vqs) {
> -		vhost_net_free(n);
> +		kvfree(n);
>  		return -ENOMEM;
>  	}
>  
> @@ -840,7 +832,7 @@ static int vhost_net_release(struct inode *inode, struct file *f)
>  	 * since jobs can re-queue themselves. */
>  	vhost_net_flush(n);
>  	kfree(n->dev.vqs);
> -	vhost_net_free(n);
> +	kvfree(n);
>  	return 0;
>  }
>  
> -- 
> 2.0.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-12  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 13:44 [PULL] vhost: infrastructure changes for 3.16 Michael S. Tsirkin
2014-06-11 13:44 ` Michael S. Tsirkin
2014-06-12  8:42 ` Romain Francoise
2014-06-12  8:42   ` Romain Francoise
2014-06-12  9:39   ` Michael S. Tsirkin
2014-06-12  9:39     ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.