From: Matt Mackall <mpm@selenic.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: jgarzik@pobox.com, netdev@oss.sgi.com, jmoyer@redhat.com
Subject: Re: [PATCH 7/7] netpoll: avoid kfree_skb on packets with destructo
Date: Thu, 3 Mar 2005 13:32:28 -0800 [thread overview]
Message-ID: <20050303213228.GU3120@waste.org> (raw)
In-Reply-To: <20050303130031.066f0862.davem@davemloft.net>
On Thu, Mar 03, 2005 at 01:00:31PM -0800, David S. Miller wrote:
> On Thu, 03 Mar 2005 14:46:32 -0600
> Matt Mackall <mpm@selenic.com> wrote:
>
> > Packets that have destructors should not be zapped here as that might
> > produce additional printk warnings via netconsole.
> >
> > Signed-off-by: Matt Mackall <mpm@selenic.com>
>
> Then where will they be freed, eh? :-)
>
> This patch adds an SKB leak. Since you've NULL'd out the list, any
> SKB skipped will never be freed up at all.
Doh. Plain as day. How's this look?
Packets that have destructors should not be zapped here as that might
produce additional printk warnings via netconsole.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Index: np/net/core/netpoll.c
===================================================================
--- np.orig/net/core/netpoll.c 2005-03-03 14:16:29.579809668 -0600
+++ np/net/core/netpoll.c 2005-03-03 15:26:38.826754614 -0600
@@ -192,7 +192,10 @@ static void zap_completion_queue(void)
while (clist != NULL) {
struct sk_buff *skb = clist;
clist = clist->next;
- __kfree_skb(skb);
+ if(skb->destructor)
+ dev_kfree_skb_any(skb); /* put this one back */
+ else
+ __kfree_skb(skb);
}
}
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2005-03-03 21:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-03 20:46 [PATCH 0/7] netpoll: recursion fixes, queueing, and cleanups Matt Mackall
2005-03-03 20:46 ` [PATCH 1/7] netpoll: shorten carrier detect timeout Matt Mackall
2005-03-03 20:46 ` [PATCH 2/7] netpoll: filter inlines Matt Mackall
2005-03-03 20:46 ` [PATCH 3/7] netpoll: add netpoll point to net_device Matt Mackall
2005-03-03 20:46 ` [PATCH 4/7] netpoll: fix ->poll() locking Matt Mackall
2005-03-03 20:46 ` [PATCH 5/7] netpoll: add optional dropping and queueing support Matt Mackall
2005-03-03 20:46 ` [PATCH 6/7] netpoll: handle xmit_lock recursion similarly Matt Mackall
2005-03-03 20:46 ` [PATCH 7/7] netpoll: avoid kfree_skb on packets with destructo Matt Mackall
2005-03-03 21:00 ` David S. Miller
2005-03-03 21:17 ` Jeff Garzik
2005-03-03 21:29 ` David S. Miller
2005-03-03 21:33 ` Jeff Garzik
2005-03-03 21:39 ` Matt Mackall
2005-03-03 21:41 ` David S. Miller
2005-03-03 21:32 ` Matt Mackall [this message]
2005-03-23 2:35 ` David S. Miller
2005-04-22 22:24 ` [PATCH 4/7] netpoll: fix ->poll() locking Jeff Moyer
2005-04-22 22:52 ` David S. Miller
2005-04-22 23:02 ` Jeff Moyer
2005-04-22 22:59 ` David S. Miller
2005-04-23 2:14 ` Matt Mackall
2005-04-23 5:12 ` David S. Miller
2005-03-06 0:09 ` [PATCH 1/7] netpoll: shorten carrier detect timeout Patrick McHardy
2005-03-06 0:20 ` Matt Mackall
2005-03-06 1:01 ` Patrick McHardy
2005-03-10 23:01 ` Matt Mackall
2005-03-11 4:35 ` Patrick McHardy
2005-03-11 4:42 ` Matt Mackall
2005-03-11 4:53 ` Patrick McHardy
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=20050303213228.GU3120@waste.org \
--to=mpm@selenic.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=jmoyer@redhat.com \
--cc=netdev@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).