Netdev List
 help / color / mirror / Atom feed
From: Christoph Paasch <christoph.paasch@uclouvain.be>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Yuchung Cheng <ycheng@google.com>,
	Neal Cardwell <ncardwell@google.com>
Subject: Re: [PATCH net-next 3/3] tcp: better TCP_SKB_CB layout to reduce cache line misses
Date: Tue, 23 Sep 2014 09:36:53 +0200	[thread overview]
Message-ID: <20140923073653.GM3291@cpaasch-mac> (raw)
In-Reply-To: <20140923072016.GL3291@cpaasch-mac>

On 23/09/14 - 09:20:16, Christoph Paasch wrote:
> Hello Eric,
> 
> On 22/09/14 - 16:50:44, Eric Dumazet wrote:
> > TCP maintains lists of skb in write queue, and in receive queues
> > (in order and out of order queues)
> > 
> > Scanning these lists both in input and output path usually requires
> > access to skb->next, TCP_SKB_CB(skb)->seq, and TCP_SKB_CB(skb)->end_seq
> > 
> > These fields are currently in two different cache lines, meaning we
> > waste lot of memory bandwidth when these queues are big and flows
> > have either packet drops or packet reorders.
> > 
> > We can move TCP_SKB_CB(skb)->header at the end of TCP_SKB_CB, because
> > this header is not used in fast path. This allows TCP to search much faster
> > in the skb lists.
> > 
> > Even with regular flows, we save one cache line miss in fast path.
> > 
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > ---
> >  include/net/tcp.h   | 12 ++++++------
> >  net/ipv4/tcp_ipv4.c |  7 +++++++
> >  net/ipv6/tcp_ipv6.c |  7 +++++++
> >  3 files changed, 20 insertions(+), 6 deletions(-)
> 
> doesn't also the tx-path relies on IPCB(skb) being memset to 0 (e.g., in
> xfrm4_output or ip_options_build)

Crap, forget about ip_options_build. It is memcpy'ing into IPCB... Confused
src with dest... :-)

Nevertheless, wouldn't there be a problem in xfrm4_output?


Cheers,
Christoph

  reply	other threads:[~2014-09-23  7:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 23:50 [PATCH net-next 0/3] tcp: better TCP_SKB_CB layout Eric Dumazet
2014-09-22 23:50 ` [PATCH net-next 1/3] ipv4: rename ip_options_echo to __ip_options_echo() Eric Dumazet
2014-09-22 23:50 ` [PATCH net-next 2/3] ipv6: add a struct inet6_skb_parm param to ipv6_opt_accepted() Eric Dumazet
2014-09-22 23:50 ` [PATCH net-next 3/3] tcp: better TCP_SKB_CB layout to reduce cache line misses Eric Dumazet
2014-09-23  7:20   ` Christoph Paasch
2014-09-23  7:36     ` Christoph Paasch [this message]
2014-09-23  9:09       ` Eric Dumazet

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=20140923073653.GM3291@cpaasch-mac \
    --to=christoph.paasch@uclouvain.be \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.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