Re: /proc/sys/kernel/shmmax does not increase shared ram

From: Christoph Rohland (cr@sap.com)
Date: Thu Aug 31 2000 - 11:27:06 EST


Michael Bielicki <Michael.Bielicki@Parmastocks.com> writes:

> Hi,
> I found this effect on both test6 and test7 that if I type:
>
> echo 128000000 > /proc/sys/kernel/shmmax
> it has no real effect on the amount of shared memory.

# uname -a
Linux ls3016 2.4.0-test7 #1 SMP Thu Aug 31 15:12:24 CEST 2000 i686 unknown
# ipcs -ml

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 1048576
max total shared memory (kbytes) = 12240000
min seg size (bytes) = 0

# cat /proc/sys/kernel/shmmax
1073741824
# ./ipctst 1 1073741824 1 0 100
using 1 segs of size 1073741824 (1 iterations)
# ./ipctst 1 1073741825 1 0 100
using 1 segs of size 1073741825 (1 iterations)
shmget (0x1): Invalid argument

So this seems to work.

> besides, what does the output of df on /dev/shm show me ? the amount
> of max shared mem in bytes or kbytes like the other fs ?

Yes, it does. You can increase the maximum overall size with mount
option nr_blocks (in 4K blocks on ia32) and the maximum number of
objects with nr_inodes.

from ipc/shm.c:

 * There are the following mount options:
 * - nr_blocks (^= shmall) is the number of blocks of size PAGE_SIZE
 * we are allowed to allocate
 * - nr_inodes (^= shmmni) is the number of files we are allowed to
 * allocate
 * - mode is the mode for the root directory (default S_IRWXUGO | S_ISVTX)

Greetings
                Christoph
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:28 EST