Subject: Re: Not beer, or why is the pipe so small?
To: None <tls@rek.tjls.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 02/25/2003 23:26:49
Thor Lancelot Simon wrote:
> I think we're talking at cross purposes.  Jaromir is talking about the
> new pipe implementation, which moves data directly in a way which makes it
> difficult for me, at least, to see what exactly the "capacity" of a pipe
> would be.
> 
> I *think* that in this implementation, if one can write at all, one can
> write at least a page: 4K on i386.  Is that not true, Jaromir?  In that 
> case, it would seem like raising PIPE_BUF, for this implementation, would 
> not be an unreasonable thing to do.

In the current implementation, the internal kernel buffer used for
nonblocking writes to pipe is 16kB, which might be adjusted to 64kB
if app issues large (>16kB) writes. The more efficient 'direct
write' memory shuffle is only used for blocking writes, and only
if the amount of data to write is >= 8kB (not dependant on page
size).  The direct write moves data around in up to 1MB chunks,
and doesn't use any intermediate buffer.

Any transfer < 8kB is done using the internal kernel buffer.
So yes, bumping PIPE_BUF to anything less than 8kB should be fine.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-