pipe: set lower and upper limit on max pages in the pipe page array splice
authorJens Axboe <jens.axboe@oracle.com>
Wed, 19 May 2010 19:03:16 +0000 (21:03 +0200)
committerJens Axboe <axboe@nehalem.(none)>
Thu, 20 May 2010 08:43:36 +0000 (10:43 +0200)
commit727099ff1e203a250db328dae8d4ff7d49898328
tree6a0667cfad6897340d65fd30e86ddd0b881af579
parentf9f8b5480eab28a15498e0f4af566c82a68f94fd
pipe: set lower and upper limit on max pages in the pipe page array

We need at least two to guarantee proper POSIX behaviour, so
never allow a smaller limit than that.

Also expose a /proc/sys/fs/pipe-max-pages sysctl file that allows
root to define a sane upper limit. Make it default to 16 times the
default size, which is 16 pages.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/pipe.c
include/linux/pipe_fs_i.h
kernel/sysctl.c