Re: [PATCH] tcp: set SPLICE_F_NONBLOCK after first buffer has beenspliced

From: Max Kellermann
Date: Thu Nov 05 2009 - 05:58:00 EST

On 2009/11/05 11:30, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> I dont think this patch is correct. Could you describe your use case ?

See my second email, there's a demo source.

> If you dont want to block on output pipe, you should set this NONBLOCK
> flag before calling splice(SPLICE_F_NONBLOCK) syscall.
> ie : Use the socket in blocking mode, but output pipe in non-blocking mode.

Do you think that a splice() should block if the socket is readable
and the pipe is writable according to select()?

"The correct behavior would be to copy as much as possible, and return
without blocking. Block only if nothing can be transferred."

Do you disagree with that?

> Some application could have a thread working in full blocking mode,
> and have another thread reading the pipe (and eventually unblocking
> first thread)

I don't get this objection. Please explain.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at