[RFC] [PATCH] tcp_splice_read: do not promote SPLICE_F_NONBLOCK to socket O_NONBLOCK

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <netdev@...>
Cc: <linux-kernel@...>
Date: Sunday, June 1, 2008 - 7:36 pm

This patch stops propagating SPLICE_F_NONBLOCK as O_NONBLOCK to the 
underlaying socket. It follows the man page semantic - or at least my 
interpretation. 

This approach also provides a simple solution to the splice transfer size 
problem. Say we have the following common sequence:

splice(socket, pipe);
splice(pipe, file);

Unless we specify SPLICE_F_NONBLOCK, we can't use arbitrarily large size 
transfers with the 1st splice since otherwise we will deadlock due to 
pipe "fullness".  But if we use SPLICE_F_NONBLOCK, the current implementation 
will make the underlying socket non-blocking and thus will force us use poll 
or other notification mechanism.

Choosing a splice transfer size so that we don't deadlock is tricky: we want 
to use a large value to improve performance (less system calls) and at the 
same time we need to stay under PIPE_BUFFERS packets. Fragmentation / MTU 
complicates this equation further.


tavi
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] [PATCH] tcp_splice_read: do not promote SPLICE_F_NONBL..., Octavian Purdila, (Sun Jun 1, 7:36 pm)