From d4bf702facd65e9c23039f33d167baf6844ab719 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 3 May 2014 14:53:06 +0200 Subject: [PATCH] shmget.2: Rework the SHMALL description Signed-off-by: Michael Kerrisk --- man2/shmget.2 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/man2/shmget.2 b/man2/shmget.2 index ea02ca6bb..8cdfc88b7 100644 --- a/man2/shmget.2 +++ b/man2/shmget.2 @@ -283,12 +283,14 @@ The following limits on shared memory segment resources affect the call: .TP .B SHMALL -System-wide limit on the number of shared memory pages. +System-wide limit on the number of +.I pages +of shared memory. Since Linux 3.17, the default value is nearly ULONG_MAX, which effectively allows unlimited allocations. -From Linux 2.4 up to -Linux 3.16, the default value for this limit was +From Linux 2.4 up to Linux 3.16, +the default value for this limit was: SHMMAX / PAGE_SIZE * (SHMMNI / 16) @@ -296,11 +298,9 @@ If .B SHMMAX and .B SHMMNI -were not modified, this yielded in a limit for the -total memory used by all shared memory segments of 8 GB: -with a 4kB page size, this formula yields the value 2^21 (2,097,152); -with 8kB page size, it yields 2^20 (1048576). - +were not modified, then multiplying the result of this formula +by the page size (to get a value in bytes) yielded a value of 8 GB +as the limit on the total memory used by all shared memory segments. On Linux, this limit can be read and modified via .IR /proc/sys/kernel/shmall . .TP