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

Previous thread: [patch -v2 23/23] qla2xxx: use memory_read_from_buffer by akinobu.mita on Sunday, June 1, 2008 - 4:13 pm. (1 message)

Next thread: Re: [git patches] net driver updates for .27 by Stephen Rothwell on Sunday, June 1, 2008 - 5:41 pm. (1 message)
From: Octavian Purdila
Date: Sunday, June 1, 2008 - 4: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 thread: [patch -v2 23/23] qla2xxx: use memory_read_from_buffer by akinobu.mita on Sunday, June 1, 2008 - 4:13 pm. (1 message)

Next thread: Re: [git patches] net driver updates for .27 by Stephen Rothwell on Sunday, June 1, 2008 - 5:41 pm. (1 message)