Subject: Re: Not beer, or why is the pipe so small?
To: Viktor Dukhovni <>
From: Jason R Thorpe <>
List: tech-kern
Date: 02/25/2003 11:11:45
On Tue, Feb 25, 2003 at 01:41:15PM -0500, Viktor Dukhovni wrote:

 > I know all this, but why is PIPE_BUF 512 bytes on NetBSD. Hysterical
 > raisins? If fewer (misguidedly non-portable) applications fail with a
 > PIPE_BUF of 4K, and if the larger PIPE_BUF has no negative performance
 > implications and perhaps even improves performance, then it seems to me
 > that PIPE_BUF should be raised.


One reason for a smaller PIPE_BUF is that you cannot wake up any threads
write-selecting on a pipe until PIPE_BUF bytes are available in the pipe.
If PIPE_BUF is large, then you run the risk of increasing the latency of
writes to the pipe, yes?

(Note, I'm not arguing whether nor not a 512 byte PIPE_BUF is correct
or not, just trying to provide a plausible reason for a small value :-)

        -- Jason R. Thorpe <>