From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH]Fix memory leak for copy-receiver of netfront Date: Wed, 11 Jun 2008 22:33:02 +0100 Message-ID: <4850448E.1020603@goop.org> References: <37C8CB88D5C4E2kasai.takanori@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <37C8CB88D5C4E2kasai.takanori@jp.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Kasai Takanori Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Kasai Takanori wrote: > Hi all, > > We found the problem of the memory leak when working with copy- > receiver of netfront. > > The source of a problem is that the fragment page is not released with > dev_kfree_skb() because the nr_frags variable of skb is set to 0. > > This is the patch to fix memory leak in netfront. > This code doesn't apply to the current 2.6.25 version of netfront. The only similar code I could see is: skb = np->rx_skbs[id]; mfn = gnttab_end_foreign_transfer_ref(ref); gnttab_release_grant_reference(&np->gref_rx_head, ref); np->grant_rx_ref[id] = GRANT_INVALID_REF; if (0 == mfn) { skb_shinfo(skb)->nr_frags = 0; dev_kfree_skb(skb); noxfer++; continue; } Would you mind reviewing the 2.6.25 version of netfront to see if it needs a patch? Thanks, J