Re: SPLICE_F_NONBLOCK semantics...

From: Jens Axboe
Date: Fri Oct 02 2009 - 03:48:01 EST


On Thu, Oct 01 2009, David Miller wrote:
> From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Date: Thu, 1 Oct 2009 15:21:44 -0700 (PDT)
>
> > On Thu, 1 Oct 2009, David Miller wrote:
> >>
> >> It depends upon our interpretation of how you intended the
> >> SPLICE_F_NONBLOCK flag to work when you added it way back
> >> when.
> >>
> >> Linus introduced SPLICE_F_NONBLOCK in 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.
> >>
> >> Linus intention was clear : let SPLICE_F_NONBLOCK control the splice pipe mode only
> >
> > Ack. The original intent was for the flag to affect the buffering, not the
> > end points.
>
> Great, thanks for reviewing.
>
> > Although the more I think about it, the more I suspect that the
> > whole NONBLOCK thing should probably have been two bits, and simply
> > been about "nonblocking input" vs "nonblocking output" (so that you
> > could control both sides on a call-by-call basis).
>
> I think we could still extend things in this way if we wanted to.
> So if you specify the explicit input and/or output nonblock flag,
> it takes precedence over the SPLICE_F_NONBLOCK thing.

Yes I agree, thank god for having a 'flags' parameter for the syscalls
:-). I'll make a note to add and test bidirectional nonblock hints.

The net patch looks fine and correct to me, feel free to add my acked-by
if you want.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/