mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-09 16:12:21 +00:00
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>
This commit is contained in:
parent
35f3d14dbb
commit
b492e95be0
3 changed files with 26 additions and 0 deletions
|
@ -52,6 +52,7 @@
|
|||
#include <linux/slow-work.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/pipe_fs_i.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/processor.h>
|
||||
|
@ -1423,6 +1424,14 @@ static struct ctl_table fs_table[] = {
|
|||
.child = binfmt_misc_table,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.procname = "pipe-max-pages",
|
||||
.data = &pipe_max_pages,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.extra1 = &two,
|
||||
},
|
||||
/*
|
||||
* NOTE: do not add new entries to this table unless you have read
|
||||
* Documentation/sysctl/ctl_unnumbered.txt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue