All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] fix memory leak in virtio_net
Date: Tue, 11 Aug 2009 14:52:58 +0300	[thread overview]
Message-ID: <4A815B9A.3060205@redhat.com> (raw)
In-Reply-To: <1249934708.7400.10.camel@localhost.localdomain>

(copying Rusty, the virtio maintainer)

On 08/10/2009 11:05 PM, Shirley Ma wrote:
> Whild reading virtio code, I found some memory leak in removing
> virtio_net.
>
> In virtnet_remove, only skb has been freed not the pages in skb
> frags. Here is the patch to fix this, please review it.
>
>    

There were indeed reports of virtio ooming; this might be the cause.

> Signed-off-by: Shirley Ma<xma@us.ibm.com>
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 2a6e81d..7e629d9 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -978,6 +978,7 @@ static void virtnet_remove(struct virtio_device *vdev)
>
>   	/* Free our skbs in send and recv queues, if any. */
>   	while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
> +		trim_pages(vi, skb);
>   		kfree_skb(skb);
>   		vi->num--;
>   	}
>
>
>
>
>    


-- 
error compiling committee.c: too many arguments to function


  parent reply	other threads:[~2009-08-11 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10 20:05 [PATCH] fix memory leak in virtio_net Shirley Ma
2009-08-11  5:03 ` Shirley Ma
2009-08-11 11:52 ` Avi Kivity [this message]
2009-08-11 16:56   ` Shirley Ma
2009-08-12 12:41   ` Rusty Russell

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=4A815B9A.3060205@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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.