From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Maciej Żenczykowski" <zenczykowski@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Tom Herbert <therbert@google.com>,
Neal Cardwell <ncardwell@google.com>,
Yuchung Cheng <ycheng@google.com>
Subject: Re: [PATCH] tcp: gso: do not generate out of order packets
Date: Wed, 15 May 2013 21:19:01 -0700 [thread overview]
Message-ID: <1368677941.4519.85.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAHo-OozZz4yx5iuoEWcq5vTJvJ0b_5bNbiQuc4PMw22jBZOxpg@mail.gmail.com>
On Wed, 2013-05-15 at 20:58 -0700, Maciej Żenczykowski wrote:
> I'd be worried that calling the destructor that many times would cause
> performance problems
> (and only call the destructor and do memory accounting on the last segment).
>
> Could we instead move the queue mapping into the skb somehow instead?
There is no performance problem, because all these packets are going to
be freed at the same time from TX completion handler.
The socket cache lines we use (sk->sk_state, sk->sk_wmem_alloc) are hot.
Anyway its way cleaner propagating socket information, as it might be
needed by netfilter or classifiers.
Some months ago I tested a variant of sock_wfree() not testing
sk>sk_state as TCP sockets set SOCK_USE_WRITE_QUEUE flag, and I had no
change in performance. sk_state & sk_wmem_alloc were on separate cache
lines :
offsetof(struct sock, sk_flags) = 0xe8
offsetof(struct sock, sk_wmem_alloc) = 0x104
void sock_fast_wfree(struct sk_buff *skb)
{
struct sock *sk = skb->sk;
if (atomic_sub_and_test(skb->truesize, &sk->sk_wmem_alloc))
__sk_free(sk);
}
next prev parent reply other threads:[~2013-05-16 4:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 1:38 [PATCH] tcp: gso: do not generate out of order packets Eric Dumazet
2013-05-16 3:58 ` Maciej Żenczykowski
2013-05-16 4:19 ` Eric Dumazet [this message]
2013-05-16 4:46 ` Eric Dumazet
2013-05-16 21:44 ` David Miller
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=1368677941.4519.85.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=ycheng@google.com \
--cc=zenczykowski@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