From: Mark McLoughlin <markmc@redhat.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org, Mark McLoughlin <markmc@redhat.com>
Subject: [PATCH 1/3] virtio_net: Fix leaked netdev->refcnt
Date: Wed, 22 Oct 2008 16:20:28 +0100 [thread overview]
Message-ID: <1224688830-26216-2-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <1224688830-26216-1-git-send-email-markmc@redhat.com>
If after receiving some packets and refilling the queue with buffers,
we detect that more packets are available then we re-schedule the
queue and process them.
This re-scheduling - i.e. calling __netif_rx_schedule() - causes a
netdev reference to be taken.
Once we've finally run out of buffers to process, we return zero and
net_rx_action() drops the reference taken by the original call to
_netif_rx_schedule() in e.g. skb_recv_done().
The reference taken by re-scheduling is always leaked, leading to:
waiting for eth0 to become free. Usage count = 132568
Fix by immediately dropping the extra reference taken.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
hack-module.awk | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hack-module.awk b/hack-module.awk
index 7cb9381..b401aae 100644
--- a/hack-module.awk
+++ b/hack-module.awk
@@ -63,6 +63,7 @@
print " if (!no_work && netif_rx_schedule_prep(vi->dev)) {";
print " vi->rvq->vq_ops->disable_cb(vi->rvq);";
print " __netif_rx_schedule(vi->dev);";
+ print " dev_put(vi->dev);";
print " goto again;";
print " }";
print "";
--
1.5.5.1
next prev parent reply other threads:[~2008-10-22 15:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 15:20 [PATCH 0/3] Some kvm-guest-drivers-linux/virtio_net fixes Mark McLoughlin
2008-10-22 15:20 ` Mark McLoughlin [this message]
2008-10-22 15:20 ` [PATCH 2/3] virtio_net: Make use of napi_weight module param Mark McLoughlin
2008-10-22 15:20 ` [PATCH 3/3] virtio_net: support ethtool offload queries Mark McLoughlin
2008-10-26 14:17 ` [PATCH 1/3] virtio_net: Fix leaked netdev->refcnt Avi Kivity
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=1224688830-26216-2-git-send-email-markmc@redhat.com \
--to=markmc@redhat.com \
--cc=avi@qumranet.com \
--cc=kvm@vger.kernel.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.