[Adding a typo fix, and correct email for Jens]
On 08/14/2016 11:13 AM, Michael Kerrisk (man-pages) wrote:
Hello Vegard,
On 08/13/2016 03:35 AM, Vegard Nossum wrote:
Cc: Willy Tarreau <w@xxxxxx>
Cc: Jens Axboe <jens.axboe@xxxxxxxxxx>
Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
---
man2/pipe.2 | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git man2/pipe.2 man2/pipe.2
index e817ba9..ecf2f34 100644
--- man2/pipe.2
+++ man2/pipe.2
@@ -184,6 +184,35 @@ POSIX.1-2001, POSIX.1-2008.
.BR pipe2 ()
is Linux-specific.
+
+.SH FILES
+On Linux, the following files control how much memory can be used for pipes:
+.SS /proc/sys/fs/pipe-max-pages " (since Linux 2.6.34)"
+.\" commit b492e95be0ae672922f4734acf3f5d35c30be948
+Deprecated since Linux 2.6.35.
+.SS /proc/sys/fs/pipe-max-size " (since Linux 2.6.35)"
+.\" commit ff9da691c0498ff81fdd014e7a0731dab2337dac
+The maximum size (in bytes) of individual pipes created or set by users
+without the
+.B CAP_SYS_RESOURCE
+capability.
+.SS /proc/sys/fs/pipe-user-pages-hard " (since Linux 4.4)"
+.\" commit 759c01142a5d0f364a462346168a56de28a80f52
+The combined maximum size (in pages) of all pipes created or set by a
+single user without both the
+.B CAP_SYS_RESOURCE
+and
+.B CAP_SYS_ADMIN
+capabilities.
+.SS /proc/sys/fs/pipe-user-pages-soft " (since Linux 4.4)"
+.\" commit 759c01142a5d0f364a462346168a56de28a80f52
+The combined size (in pages) of all pipes created or set by a single
+user (without both the
+.B CAP_SYS_RESOURCE
+and
+.B CAP_SYS_ADMIN
+capabilities) after which individual pipes will be limited to 1 page.
+
.SH EXAMPLE
.\" fork.2 refers to this example program.
The following program creates a pipe, and then
Thanks. I've added this text to pipe(7) (rather than pipe(2)), and
expanded it considerably:
/proc files
On Linux, the following files control how much memory can be used
for pipes:
/proc/sys/fs/pipe-max-pages (only in Linux 2.6.34)
An upper limit, in pages, on the capacity that an unprivi‐
leged user (one without the CAP_SYS_ADMIN capability) can
s/CAP_SYS_ADMIN/CAP_SYS_RESOURCE/
(Along the way, I injected that as a typo.)
set for a pipe. The default value for this limit is 16
times the default pipe capacity (see above); the lower
limit is two pages. This interface was removed in Linux
2.6.35, in favor of /proc/sys/fs/pipe-max-size.
/proc/sys/fs/pipe-max-size (since Linux 2.6.35)
The maximum size (in bytes) of individual pipes created or
set by users without the CAP_SYS_RESOURCE capability. The
default value for this file is 1048576. Attempts to set a
limit less than the page size cause write(2) to fail with
the error EINVAL.
/proc/sys/fs/pipe-user-pages-hard (since Linux 4.5)
The hard limit on the total size (in pages) of all pipes
created or set by a single unprivileged user (i.e., one
with neither the CAP_SYS_RESOURCE nor the CAP_SYS_ADMIN
capability). So long as the total number of pages allo‐
cated to pipe buffers for this user is at this limit,
attempts to create new pipes will be denied, and attempts
to increase a pipe's capacity will be denied.
When the value of this limit is zero (which is the
default), no hard limit is applied.
/proc/sys/fs/pipe-user-pages-soft (since Linux 4.5)
The soft limit on the total size (in pages) of all pipes
created or set by a single unprivileged user (.e., one with
neither the CAP_SYS_RESOURCE nor the CAP_SYS_ADMIN capabil‐
ity). So long as the total number of pages allocated to
pipe buffers for this user is at this limit, individual
pipes created by a user will be limited to one page, and
attempts to increase a pipe's capacity will be denied.
When the value of this limit is zero, no soft limit is
applied. The default value for this file is 16384, which
permits creating up to 1024 pipes with the default capac‐
ity.
How does the above seem?
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html