LKML Archive mirror
 help / color / mirror / Atom feed
* PIPE_SIZE aspects
@ 2009-05-22  9:39 Ad van den Broek
  2009-05-23 19:54 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ad van den Broek @ 2009-05-22  9:39 UTC (permalink / raw
  To: linux-kernel

I searched the net regarding PIPE_SIZE aspects.
This is what I found:

* The constant PIPE_SIZE
establishes the number of bytes allocated for a pipe
(the size of the pipe buffer)

* The default of PIPE_SIZE (in Linux 2.4) is PAGE_SIZE.
* The default of PIPE_SIZE (in Linux 2.6) is 64K.

* PAGE_SIZE (in Linux 2.4) is CPU/hw depending,
  may not be changed and is 4K for x86.
* PAGE_SIZE (in Linux 2.6) is 64K.

* PIPE_SIZE can be changed in Linux 2.4,
  but it should be NOT larger than PAGE_SIZE
  or a patch should be implemented

 I found a patch (I believe the author is Julian Bradfield) at
 http://lse.sourceforge.net/pipe/2.4.9-pipe.patch
 and this patch is modified by Manfred Spraul which version can be found at
 http://linuxperf.sourceforge.net/patches/2.4.13-largepipe.patch
 It is tested with PIPE_SIZE from 1 upto 2,4,8 pages.
 and the result is at http://lse.sourceforge.net/pipe/pipe-report.txt


My questions:
 Is the above info correct ?
 Is the large pipe patch still correct for last 2.4.x versions ?
 Is such a patch also required/possible in Linux 2.6
 to allow PIPE_SIZE > PAGE_SIZE or is that different in 2.6 ?



-- 

With best regards,
Ad van den Broek
The Netherlands

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PIPE_SIZE aspects
  2009-05-22  9:39 PIPE_SIZE aspects Ad van den Broek
@ 2009-05-23 19:54 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2009-05-23 19:54 UTC (permalink / raw
  To: Ad van den Broek; +Cc: linux-kernel

On Fri, May 22 2009, Ad van den Broek wrote:
> I searched the net regarding PIPE_SIZE aspects.
> This is what I found:
> 
> * The constant PIPE_SIZE
> establishes the number of bytes allocated for a pipe
> (the size of the pipe buffer)
> 
> * The default of PIPE_SIZE (in Linux 2.4) is PAGE_SIZE.
> * The default of PIPE_SIZE (in Linux 2.6) is 64K.
> 
> * PAGE_SIZE (in Linux 2.4) is CPU/hw depending,
>   may not be changed and is 4K for x86.
> * PAGE_SIZE (in Linux 2.6) is 64K.

No changes for PAGE_SIZE, it's still hw dependent (and, one some archs,
dependent on kernel config).

> * PIPE_SIZE can be changed in Linux 2.4,
>   but it should be NOT larger than PAGE_SIZE
>   or a patch should be implemented
> 
>  I found a patch (I believe the author is Julian Bradfield) at
>  http://lse.sourceforge.net/pipe/2.4.9-pipe.patch
>  and this patch is modified by Manfred Spraul which version can be found at
>  http://linuxperf.sourceforge.net/patches/2.4.13-largepipe.patch
>  It is tested with PIPE_SIZE from 1 upto 2,4,8 pages.
>  and the result is at http://lse.sourceforge.net/pipe/pipe-report.txt
> 
> 
> My questions:
>  Is the above info correct ?
>  Is the large pipe patch still correct for last 2.4.x versions ?
>  Is such a patch also required/possible in Linux 2.6
>  to allow PIPE_SIZE > PAGE_SIZE or is that different in 2.6 ?

2.6 uses an array of pages for the pipe. So while the x86 page size is
still 4kb, a pipe is by default 64kb because the array holds 16 pages.

I wrote a patch to set/get the pipe size for 2.6 if you are interested.
Find it here:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=24547ac4d97bebb58caf9ce58bd507a95c812a3f

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-23 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22  9:39 PIPE_SIZE aspects Ad van den Broek
2009-05-23 19:54 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).