From: Eric Dumazet <eric.dumazet@gmail.com>
To: Igor Royzis <igorr@swortex.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Tom Herbert <therbert@google.com>,
Daniel Borkmann <dborkman@redhat.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Simon Horman <horms@verge.net.au>, Joe Perches <joe@perches.com>,
Jiri Pirko <jiri@resnulli.us>, Florian Westphal <fw@strlen.de>,
Paul Durrant <Paul.Durrant@citrix.com>,
Thomas Graf <tgraf@suug.ch>, Jan Beulich <JBeulich@suse.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Miklos Szeredi <mszeredi@suse.cz>,
linux-kernel <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
Anton Nayshtut <anton@swortex.com>
Subject: Re: [PATCH] Fixed zero copy GSO without orphaning the fragments
Date: Tue, 20 May 2014 07:28:56 -0700 [thread overview]
Message-ID: <1400596136.5367.125.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <1400585062-13580-1-git-send-email-igorr@swortex.com>
On Tue, 2014-05-20 at 14:24 +0300, Igor Royzis wrote:
> Fix accessing GSO fragments memory (and a possible corruption therefore) after
> reporting completion in a zero copy callback. The previous fix in the commit 1fd819ec
> orphaned frags which eliminates zero copy advantages. The fix makes the completion
> called after all the fragments were processed avoiding unnecessary orphaning/copying
> from userspace.
>
> The GSO fragments corruption issue was observed in a typical QEMU/KVM VM setup that
> hosts a Windows guest (since QEMU virtio-net Windows driver doesn't support GRO).
> The fix has been verified by running the HCK OffloadLSO test.
>
> Signed-off-by: Igor Royzis <igorr@swortex.com>
> Signed-off-by: Anton Nayshtut <anton@swortex.com>
> ---
> include/linux/skbuff.h | 1 +
> net/core/skbuff.c | 18 +++++++++++++-----
> 2 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 08074a8..8c49edc 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -287,6 +287,7 @@ struct skb_shared_info {
> struct sk_buff *frag_list;
> struct skb_shared_hwtstamps hwtstamps;
> __be32 ip6_frag_id;
> + struct sk_buff *zcopy_src;
>
Before your patch :
sizeof(struct skb_shared_info)=0x140
offsetof(struct skb_shared_info, frags[1])=0x40
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) -> 0x140
After your patch :
sizeof(struct skb_shared_info)=0x148
offsetof(struct skb_shared_info, frags[1])=0x48
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) -> 0x180
Thats a serious bump, because it increases all skb truesizes, and
typical skb with one fragment will use 2 cache lines instead of one in
struct skb_shared_info, so this adds memory pressure in fast path.
So while this patch might increase performance for some workloads,
it generally decreases performance on many others.
next prev parent reply other threads:[~2014-05-20 14:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 11:24 Igor Royzis
2014-05-20 11:50 ` Michael S. Tsirkin
2014-05-20 12:07 ` Anton Nayshtut
2014-05-25 10:54 ` Igor Royzis
2014-05-20 14:28 ` Eric Dumazet [this message]
2014-05-20 16:05 ` Eric Dumazet
2014-05-20 16:16 ` Michael S. Tsirkin
2014-05-25 11:09 ` Igor Royzis
2014-06-01 11:39 Igor Royzis
2014-06-01 12:21 ` Michael S. Tsirkin
2014-06-03 11:54 ` Igor Royzis
2014-06-03 13:49 ` 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=1400596136.5367.125.camel@edumazet-glaptop2.roam.corp.google.com \
--to=eric.dumazet@gmail.com \
--cc=JBeulich@suse.com \
--cc=Paul.Durrant@citrix.com \
--cc=anton@swortex.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=horms@verge.net.au \
--cc=igorr@swortex.com \
--cc=jiri@resnulli.us \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mszeredi@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=tgraf@suug.ch \
--cc=therbert@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
all inboxes | Powered by JetHome®