From: Willy Tarreau <w@1wt.eu>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Major network performance regression in 3.7
Date: Sun, 6 Jan 2013 20:34:10 +0100 [thread overview]
Message-ID: <20130106193410.GL16031@1wt.eu> (raw)
In-Reply-To: <1357498815.6919.570.camel@edumazet-glaptop>
On Sun, Jan 06, 2013 at 11:00:15AM -0800, Eric Dumazet wrote:
> On Sun, 2013-01-06 at 10:51 -0800, Eric Dumazet wrote:
> > >
> > > (sd->len is usually 4096, which is expected, but sd->total_len value is
> > > huge in your case, so we always set the flag in fs/splice.c)
> >
> > I am testing :
> >
> > if (sd->len < sd->total_len && pipe->nrbufs > 1)
> > more |= MSG_SENDPAGE_NOTLAST;
> >
>
> Yes, this should fix the problem :
>
> If there is no following buffer in the pipe, we should not set NOTLAST.
>
> diff --git a/fs/splice.c b/fs/splice.c
> index 8890604..6909d89 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -696,8 +696,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
> return -EINVAL;
>
> more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
> - if (sd->len < sd->total_len)
> +
> + if (sd->len < sd->total_len && pipe->nrbufs > 1)
> more |= MSG_SENDPAGE_NOTLAST;
> +
> return file->f_op->sendpage(file, buf->page, buf->offset,
> sd->len, &pos, more);
> }
OK it works like a charm here now ! I can't break it anymore, so it
looks like you finally got it !
I noticed that the data rate was higher when the loopback's MTU
is exactly a multiple of 4096 (making the 64k choice optimal)
while I would have assumed that in order to efficiently splice
TCP segments, we'd need to have some space for IP/TCP headers
and n*4k for the payload.
I also got the transfer freezes again a few times when starting
tcpdump on the server, but this is not 100% reproducible I'm afraid.
So I'll bring this back when I manage to get some analysable pattern.
The spliced transfer through all the chain haproxy works fine again
at 10gig with your fix. The issue is closed for me. Feel free to add
my Tested-By if you want.
Thank you Eric :-)
Willy
next prev parent reply other threads:[~2013-01-06 19:34 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-05 21:49 Major network performance regression in 3.7 Willy Tarreau
2013-01-05 23:18 ` Eric Dumazet
2013-01-05 23:29 ` Willy Tarreau
2013-01-06 0:02 ` Eric Dumazet
2013-01-06 0:50 ` Willy Tarreau
2013-01-06 1:21 ` Eric Dumazet
2013-01-06 1:30 ` Willy Tarreau
2013-01-06 1:40 ` Eric Dumazet
2013-01-06 1:51 ` Eric Dumazet
2013-01-06 2:16 ` Eric Dumazet
2013-01-06 2:18 ` Willy Tarreau
2013-01-06 2:22 ` Eric Dumazet
2013-01-06 2:32 ` Willy Tarreau
2013-01-06 2:44 ` Eric Dumazet
2013-01-06 2:52 ` Willy Tarreau
2013-01-06 7:31 ` [PATCH net-next] net: splice: avoid high order page splitting Eric Dumazet
2013-01-07 5:07 ` David Miller
2013-01-06 7:35 ` Major network performance regression in 3.7 Eric Dumazet
2013-01-06 9:24 ` Willy Tarreau
2013-01-06 10:25 ` Willy Tarreau
2013-01-06 11:46 ` Romain Francoise
2013-01-06 11:53 ` Willy Tarreau
2013-01-06 12:01 ` Willy Tarreau
2013-01-06 14:59 ` Eric Dumazet
2013-01-06 15:51 ` Willy Tarreau
2013-01-06 16:39 ` Eric Dumazet
2013-01-06 16:44 ` Willy Tarreau
2013-01-06 17:10 ` Eric Dumazet
2013-01-06 17:35 ` Willy Tarreau
2013-01-06 18:39 ` Eric Dumazet
2013-01-06 18:43 ` Eric Dumazet
2013-01-06 18:51 ` Eric Dumazet
2013-01-06 19:00 ` Eric Dumazet
2013-01-06 19:34 ` Willy Tarreau [this message]
2013-01-06 19:39 ` Eric Dumazet
2013-01-06 19:53 ` Willy Tarreau
2013-01-07 4:21 ` [PATCH] tcp: fix MSG_SENDPAGE_NOTLAST logic Eric Dumazet
2013-01-07 4:59 ` David Miller
2013-01-06 21:49 ` Major network performance regression in 3.7 John Stoffel
2013-01-06 21:52 ` Willy Tarreau
2013-01-06 21:55 ` John Stoffel
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=20130106193410.GL16031@1wt.eu \
--to=w@1wt.eu \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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).