From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ulrich Drepper <drepper@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: sendfile and EAGAIN
Date: Sat, 02 Mar 2013 19:09:05 -0800 [thread overview]
Message-ID: <1362280145.15793.70.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAOPLpQe5SfdWYv5QD4Fu90PXyS7SrSN_5Gntk2x5D5ea8ke64g@mail.gmail.com>
On Sat, 2013-03-02 at 20:41 -0500, Ulrich Drepper wrote:
> On Mon, Feb 25, 2013 at 2:22 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > I don't understand the issue.
> >
> > sendfile() returns -EAGAIN only if no bytes were copied to the socket.
>
> There is something wrong/unexpected/...
>
> I have a program which can use either sendfile or send. When using
> sendfile to transmit a large block (I've seen it with 900k) the
> sendfile call does not transmit everything. There receiver gets only
> about 600k. This is the situation when I think I've seen EAGAIN
> errors from sendmail but I cannot just now reproduce it. This is with
> sockets of AF_UNIX type.
There is no real sendfile() support for AF_UNIX.
It does a copy.
( sock_no_sendpage() fallback )
>
> Are there any limits to take into account?
This is totally expected that sendfile() doesn't queue the whole file,
if the transport is slower than the producer.
You cant ask for non blocking operation and expect sendfile() storing
Gigabytes of data in the kernel, even if its only meta data.
Using non blocking IO means the sender (and the receiver) must be able
to perform several operations, as long as the whole transfert is not
finished.
next prev parent reply other threads:[~2013-03-03 3:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-25 17:22 Ulrich Drepper
2013-02-25 19:22 ` Eric Dumazet
2013-03-03 1:41 ` Ulrich Drepper
2013-03-03 3:09 ` Eric Dumazet [this message]
2013-03-03 3:16 ` Ulrich Drepper
2013-03-04 10:28 ` Eric Wong
2013-03-05 0:11 ` Ulrich Drepper
2013-03-03 3:53 ` H. Peter Anvin
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=1362280145.15793.70.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=drepper@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®