netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: netdev@vger.kernel.org
Subject: Re: fixing sk_stream_rfree()
Date: Sun, 16 Apr 2006 22:32:03 -0700 (PDT)	[thread overview]
Message-ID: <20060416.223203.47773632.davem@davemloft.net> (raw)
In-Reply-To: <20060416111831.GA15093@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sun, 16 Apr 2006 21:18:31 +1000

> Great eyes! Yes that bug seems to have been around forever.  I'll
> look over the patch tomorrow as right now I'm still on west-coast
> time :)

Let me save you some time, later in the thread you'll find
out that this whole thing is a dead end.

The reason is that all SKBs are unshared when we receive them
into the TCP stack for sk->sk_receive_queue.  (this is done
by ip_rcv()).

This means every __kfree_skb() call would happen in the context
of the TCP stack with the socket locked, so no concurrency issues
wrt. sk_forward_alloc as I originally thought.

In fact, this is what makes using __kfree_skb() explicitly legal
in the first place.  If skb->users could be non-zero, from tcpdump
etc., then we'd be required to call kfree_skb() in the TCP code
that frees up used packets on the receive queue.

But all is not lost, this is an important datapoint.  We've audited
the receive side accesses to sk_forward_alloc and it all looks good.

And again, as you mention, we go back again to TSO being the deciding
factor in triggering this or not.

So it nearly has to be a send side issue that can only trigger with
TSO enabled, and my next planned chore is to audit the TSO splitting
during ACK processing.  We may be doing something stupid there.

  reply	other threads:[~2006-04-17  5:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-15  3:59 fixing sk_stream_rfree() David S. Miller
2006-04-15  8:23 ` David S. Miller
2006-04-15  9:03   ` David S. Miller
2006-04-16 11:18 ` Herbert Xu
2006-04-17  5:32   ` David S. Miller [this message]
2006-04-17  6:17     ` Herbert Xu
2006-04-17 20:27       ` Jesse Brandeburg
2006-04-17 20:29       ` David S. Miller
2006-04-17 21:09         ` Jesse Brandeburg
2006-04-17 21:40           ` Herbert Xu
2006-04-17 21:56             ` Jesse Brandeburg
2006-04-18 11:49 ` Ingo Oeser

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=20060416.223203.47773632.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@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 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).