From: "David Wang" <00107082@163.com>
To: "Dave Chinner" <david@fromorbit.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PERFORMANCE]fs: sendfile suffer performance degradation when buffer size have performance impact on underling IO
Date: Mon, 23 Oct 2023 10:16:14 +0800 (CST) [thread overview]
Message-ID: <61f74c43.16f9.18b5a51868f.Coremail.00107082@163.com> (raw)
In-Reply-To: <ZTWn3QtTggmMHWxS@dread.disaster.area>
At 2023-10-23 06:53:17, "Dave Chinner" <david@fromorbit.com> wrote:
>
>O_DSYNC is the problem here.
>
>This forces an IO to disk for every write IO submission from
>sendfile to the filesystem. For synchronous IO (as in "waiting for
>completion before sending the next IO), a larger IO size will
>*always* move data faster to storage.
>
>FWIW, you'll get the same behaviour if you use O_DIRECT for either
>source or destination file with sendfile - synchronous 64kB IOs are
>a massive performance limitation even without O_DSYNC.
>
>IOWs, don't use sendfile like this. Use buffered IO and
>sendfile(fd); fdatasync(fd); if you need data integrity guarantees
>and you won't see any perf problems resulting from the size of the
>internal sendfile buffer....
>
>-Dave.
>--
>Dave Chinner
>david@fromorbit.com
Thanks for the information, and Yes, buffered IO shows no significant
performance difference.
Feel that this usage caveat should be recorded in the "NOTE" section of man page for sendfile.
Thanks
David
prev parent reply other threads:[~2023-10-23 2:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-21 0:19 [PERFORMANCE]fs: sendfile suffer performance degradation when buffer size have performance impact on underling IO David Wang
2023-10-22 22:53 ` Dave Chinner
2023-10-23 2:16 ` David Wang [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=61f74c43.16f9.18b5a51868f.Coremail.00107082@163.com \
--to=00107082@163.com \
--cc=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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).