From: Max Kellermann <mk@cm4all.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH] tcp: set SPLICE_F_NONBLOCK after first buffer has been spliced
Date: Thu, 5 Nov 2009 15:33:20 +0100 [thread overview]
Message-ID: <20091105143320.GA22787@rabbit.intern.cm-ag> (raw)
In-Reply-To: <4AF2DD21.8060604@gmail.com>
On 2009/11/05 15:11, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> It cannot, therefore an application uses O_NDELAY to avoid blocking.
>
> Try following program if you are not convinced
Indeed, I'm surprised by the result rendered by the Linux kernel.
That however still contradicts with the poll() documentation.
So this boils down to the question: kernel bug or documentation bug?
http://www.opengroup.org/onlinepubs/9699919799/functions/pselect.html
"A descriptor shall be considered ready for writing when a call to an
output function with O_NONBLOCK clear would not block, whether or not
the function would transfer data successfully."
There is no size limit mentioned here. Your program reveals that the
kernel violates this definition.
> Your patch basically makes SPLICE_F_NONBLOCK option always set
> (choice 1) above)
[...]
> Why in the first place have an option if it is always set ?
It is not, you misunderstood my patch. If there's no room in the pipe
buffer, then the first iteration of the "while" loop will block (as
usual). *After* the first iteration has finished (and at least one
buffer has been moved already), the flag is set, and further
iterations will not block.
prev parent reply other threads:[~2009-11-05 14:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091105095947.32131.99768.stgit@rabbit.intern.cm-ag>
2009-11-05 10:30 ` [PATCH] tcp: set SPLICE_F_NONBLOCK after first buffer has been spliced Eric Dumazet
2009-11-05 10:57 ` Max Kellermann
2009-11-05 11:21 ` Eric Dumazet
2009-11-05 13:23 ` Max Kellermann
2009-11-05 14:11 ` Eric Dumazet
2009-11-05 14:33 ` Max Kellermann [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=20091105143320.GA22787@rabbit.intern.cm-ag \
--to=mk@cm4all.com \
--cc=eric.dumazet@gmail.com \
--cc=jens.axboe@oracle.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).