From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Volker Lendecke <vl@samba.org>,
linux-kernel@vger.kernel.org
Subject: Re: Splice on blocking TCP sockets again..
Date: Thu, 1 Oct 2009 16:17:06 -0600 [thread overview]
Message-ID: <20091001221706.GA5191@obsidianresearch.com> (raw)
In-Reply-To: <4AC2F3E4.5000904@gmail.com>
On Wed, Sep 30, 2009 at 08:00:04AM +0200, Eric Dumazet wrote:
> >> I admit I don't understand why SPLICE_F_NONBLOCK exists, it seems very
> >> un-unixy to have a syscall completely ignore the NONBLOCK flag of the
> >> fd it is called on. Ie setting NONBLOCK on the pipe itself does
> >> nothing when using splice..
> >
> > Hmm, good question, I dont have the answer but I'll digg one.
> >
>
> commit 29e350944fdc2dfca102500790d8ad6d6ff4f69d
> splice: add SPLICE_F_NONBLOCK flag
>
> It doesn't make the splice itself necessarily nonblocking (because the
> actual file descriptors that are spliced from/to may block unless they
> have the O_NONBLOCK flag set), but it makes the splice pipe operations
> nonblocking.
>
> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
>
> See Linus intention was pretty clear : O_NONBLOCK should be taken
> into account by 'actual file that are spliced from/to', regardless
> of SPLICE_F_NONBLOCK flag
Yes, that seems reasonable.
What confuses me is that if O_NONBLOCK is set on the _pipe_ and
SPICE_F_NONBLOCK is not set on the splice call the splice still blocks
- that is unlike other unix apis, eg MSG_DONTWAIT
It seems to me that SPICE_F_NONBLOCK should be or'd with O_NONBLOCK on
the pipe?
Thanks,
Jason
next prev parent reply other threads:[~2009-10-01 22:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-30 0:48 Splice on blocking TCP sockets again Jason Gunthorpe
2009-09-30 4:54 ` Eric Dumazet
2009-09-30 5:40 ` Jason Gunthorpe
2009-09-30 5:51 ` Eric Dumazet
2009-09-30 6:00 ` Eric Dumazet
2009-09-30 6:19 ` Eric Dumazet
2009-10-01 22:17 ` Jason Gunthorpe [this message]
2009-09-30 6:37 ` Volker Lendecke
2009-10-02 17:10 ` Jason Gunthorpe
2009-10-02 18:05 ` Eric Dumazet
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=20091001221706.GA5191@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vl@samba.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).