netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	eric.dumazet@gmail.com, socketcan@hartkopp.net,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out
Date: Wed, 22 Sep 2010 12:59:01 +0200	[thread overview]
Message-ID: <20100922105901.GB16028@redhat.com> (raw)
In-Reply-To: <AANLkTi=iYahjwZt5w53xFsU7fyHr72wXHd9tycwUiNE9@mail.gmail.com>

On Wed, Sep 22, 2010 at 05:35:07PM +0800, Changli Gao wrote:
> On Wed, Sep 15, 2010 at 1:23 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > Hmm, and there's another issue I think I see here:
> > destructor_arg now points to a socket.
> > What happens if the skb gets queued on an interface for a very long time
> > (as can be the case with e.g. tap), and meanwhile
> > you try to kill the task that owns the socket, which
> > will try to destroy the socket?
> >
> > Original code handles this by relevant devices orphaning an skb
> > if it's queued indefinitely.
> >
> 
> I don't think the skb_orphan() there is used to destroy the socket in
> time, but notify the socket that skbs are sent out and it can send new
> skbs.

Well, the result is that we drop a socket reference from the skb,
so it becomes possible to free the socket.

> -- 
> Regards,
> Changli Gao(xiaosuo@gmail.com)

  reply	other threads:[~2010-09-22 11:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-11  3:23 [PATCH v2] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out Changli Gao
2010-09-12 12:13 ` Michael S. Tsirkin
2010-09-15  3:20   ` David Miller
2010-09-15  5:23     ` Michael S. Tsirkin
2010-09-22  9:35       ` Changli Gao
2010-09-22 10:59         ` Michael S. Tsirkin [this message]
2010-09-22  9:24     ` Changli Gao

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=20100922105901.GB16028@redhat.com \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=xiaosuo@gmail.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).