All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Romain Francoise <romain@orebokech.com>
Cc: sfr@canb.auug.org.au, linux-scsi@vger.kernel.org,
	kvm@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Al Viro <viro@zeniv.linux.org.uk>,
	nab@daterainc.com, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PULL] vhost: infrastructure changes for 3.16
Date: Thu, 12 Jun 2014 12:39:15 +0300	[thread overview]
Message-ID: <20140612093915.GD22230@redhat.com> (raw)
In-Reply-To: <87mwdiwmbp.fsf@kima.orebokech.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Romain Francoise <romain@orebokech.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	nab@daterainc.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, sfr@canb.auug.org.au,
	linux-scsi@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PULL] vhost: infrastructure changes for 3.16
Date: Thu, 12 Jun 2014 12:39:15 +0300	[thread overview]
Message-ID: <20140612093915.GD22230@redhat.com> (raw)
In-Reply-To: <87mwdiwmbp.fsf@kima.orebokech.com>

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

  reply	other threads:[~2014-06-12  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-06-12  9:39     ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140612093915.GD22230@redhat.com \
    --to=mst@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@daterainc.com \
    --cc=netdev@vger.kernel.org \
    --cc=romain@orebokech.com \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.