DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paul Emmerich <emmericp@net.in.tum.de>
To: dev@dpdk.org
Subject: Re: [dpdk-dev] TX performance regression caused by the mbuf cachline split
Date: Tue, 12 May 2015 00:32:05 +0200	[thread overview]
Message-ID: <55512DE5.7010800@net.in.tum.de> (raw)
In-Reply-To: <554FF482.9080103@net.in.tum.de>

Paul Emmerich:
> I naively tried to move the pool pointer into the first cache line in
> the v2.0.0 tag and the performance actually decreased, I'm not yet sure
> why this happens. There are probably assumptions about the cacheline
> locations and prefetching in the code that would need to be adjusted.

This happens because the next-pointer in the mbuf is touched almost 
everywhere, even for mbufs with only one segment because it is used to 
determine if there is another segment (instead of using the nb_segs field).

I guess a solution for me would be to use a custom layout that is 
optimized for tx. I can shrink ol_flags to 32 bits and move the seqn and 
hash fields to the second cache line. A quick-and-dirty test shows that 
this even gives me a slightly higher performance than DPDK 1.7 in the 
full-featured tx path.
This is probably going to break the vector rx/tx path, but I can't use 
that anyways since I always need offloading features (timestamping and 
checksums).

I'll have to see how this affects the rx path. But I value tx 
performance over rx performance. My rx logic is usually very simple.

This solution is kind of ugly. I would prefer to be able to use an 
unmodified version of DPDK :/


By the way, I think there is something wrong with this assumption in 
commit f867492346bd271742dd34974e9cf8ac55ddb869:
> The general approach that we are looking to take is to focus the first
> cache line on fields that are updated on RX , so that receive only deals
> with one cache line.

I think this might be wrong due to the next pointer. I'll probably build 
a simple rx-only benchmark in a few weeks or so. I suspect that it will 
also be significantly slower. But that should be fixable.


Paul

  parent reply	other threads:[~2015-05-11 22:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11  0:14 Paul Emmerich
2015-05-11  9:13 ` Luke Gorrie
2015-05-11 10:16   ` Paul Emmerich
2015-05-11 22:32 ` Paul Emmerich [this message]
2015-05-11 23:18   ` Paul Emmerich
2015-05-12  0:28     ` Marc Sune
2015-05-12  0:38       ` Marc Sune
2015-05-13  9:03     ` Ananyev, Konstantin
2016-02-15 19:15       ` Paul Emmerich
2016-02-19 12:31         ` Olivier MATZ

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=55512DE5.7010800@net.in.tum.de \
    --to=emmericp@net.in.tum.de \
    --cc=dev@dpdk.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).