From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: Ofer Heifetz <oferh@marvell.com>, Changli Gao <xiaosuo@gmail.com>,
Jens Axboe <axboe@kernel.dk>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Splice status
Date: Mon, 26 Jul 2010 22:50:01 +0200 [thread overview]
Message-ID: <1280177401.2531.13.camel@edumazet-laptop> (raw)
In-Reply-To: <4C4DF220.1050307@gmail.com>
Le lundi 26 juillet 2010 à 22:37 +0200, Jarek Poplawski a écrit :
> Ofer Heifetz wrote, On 25.07.2010 16:47:
>
> > Hi Eric,
> >
> > Still trying to get better performance with splice, I noticed that when using splice there are twice the file size memcpy (placed a counter in memcpy), I verified it via samba file transfer and splice-fromnet/out.
> >
> > I also used the splice-fromnet/out and using ftrace I did notice that data is copied twice using these routines: skb_splice_bits, pipe_to_file.
>
>
> I'm not sure you're using optimal NIC for splice, which should use
> skbs with almost all data paged (non-linear), like niu or myri10ge.
>
> Jarek P.
Yes, I dont think splice() _should_ be faster, with a NIC delivering
frames of 1460 (or less bytes), when disk IO should be performed with 4
Kbytes blocs (or a multiple) to get good performance.
sendfile(file -> socket) is fast because blocs are pages, but
splice(socket -> file) is not fast, unless the NIC is able to perform
tcp receive offload.
To take an analogy, think about libc stdio versus read(2)/write(2)
syscalls. stdio, while doing copies in intermediate buffers, is able to
be faster than read()/write() in most cases.
Using splice() with 1460 bytes frames is like using read()/write()
instead of nice sized buffers given by stdio layer.
zero-copy can hurt badly if the IO sizes are not page aligned.
prev parent reply other threads:[~2010-07-26 20:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 9:26 Splice status Ofer Heifetz
2010-07-05 9:59 ` Changli Gao
2010-07-05 10:52 ` Ofer Heifetz
2010-07-05 12:08 ` Changli Gao
2010-07-05 12:50 ` Eric Dumazet
2010-07-05 13:47 ` Ofer Heifetz
2010-07-05 15:34 ` Eric Dumazet
2010-07-06 2:01 ` Changli Gao
2010-07-06 2:36 ` Ofer Heifetz
2010-07-06 3:56 ` Eric Dumazet
2010-07-11 13:08 ` Changli Gao
2010-07-13 11:41 ` Ofer Heifetz
2010-07-13 12:32 ` Changli Gao
2010-07-13 12:42 ` Ofer Heifetz
2010-07-13 13:58 ` Changli Gao
2010-07-13 14:40 ` Ofer Heifetz
2010-07-13 14:11 ` Eric Dumazet
2010-07-14 15:08 ` Ofer Heifetz
2010-07-15 3:47 ` Ofer Heifetz
2010-07-25 14:47 ` Ofer Heifetz
2010-07-26 7:41 ` Changli Gao
2010-07-26 20:37 ` Jarek Poplawski
2010-07-26 20:50 ` Eric Dumazet [this message]
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=1280177401.2531.13.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=axboe@kernel.dk \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=oferh@marvell.com \
--cc=xiaosuo@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