Where does Linux set the default values for SHMMAX?
Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
18446744073692774399
$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399
kernel memory shared-memory
add a comment |Â
up vote
6
down vote
favorite
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
18446744073692774399
$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399
kernel memory shared-memory
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
18446744073692774399
$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399
kernel memory shared-memory
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
18446744073692774399
$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399
kernel memory shared-memory
asked Jun 14 '17 at 0:47
Evan Carroll
4,47683472
4,47683472
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
The __init
function ipc_ns_init
sets the initial value of shmmax
by calling shm_init_ns
, which sets it to the value of the SHMMAX
macro.
The definition of SHMMAX
is in <uapi/linux/shm.h>
:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value you found, 18446744073692774399
.
add a comment |Â
up vote
0
down vote
On the fly you can just echo into /proc/sys/kernel/shmmax!
# echo 20446744073692774399 > /proc/sys/kernel/shmmax
But most people edit /etc/sysctl.conf with a line similar to:
kernel.shmmax=your_new_value_here
See the sysctl(8) man page.
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
The __init
function ipc_ns_init
sets the initial value of shmmax
by calling shm_init_ns
, which sets it to the value of the SHMMAX
macro.
The definition of SHMMAX
is in <uapi/linux/shm.h>
:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value you found, 18446744073692774399
.
add a comment |Â
up vote
5
down vote
accepted
The __init
function ipc_ns_init
sets the initial value of shmmax
by calling shm_init_ns
, which sets it to the value of the SHMMAX
macro.
The definition of SHMMAX
is in <uapi/linux/shm.h>
:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value you found, 18446744073692774399
.
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
The __init
function ipc_ns_init
sets the initial value of shmmax
by calling shm_init_ns
, which sets it to the value of the SHMMAX
macro.
The definition of SHMMAX
is in <uapi/linux/shm.h>
:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value you found, 18446744073692774399
.
The __init
function ipc_ns_init
sets the initial value of shmmax
by calling shm_init_ns
, which sets it to the value of the SHMMAX
macro.
The definition of SHMMAX
is in <uapi/linux/shm.h>
:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value you found, 18446744073692774399
.
answered Jun 14 '17 at 2:40
Wumpus Q. Wumbley
4,0001119
4,0001119
add a comment |Â
add a comment |Â
up vote
0
down vote
On the fly you can just echo into /proc/sys/kernel/shmmax!
# echo 20446744073692774399 > /proc/sys/kernel/shmmax
But most people edit /etc/sysctl.conf with a line similar to:
kernel.shmmax=your_new_value_here
See the sysctl(8) man page.
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
add a comment |Â
up vote
0
down vote
On the fly you can just echo into /proc/sys/kernel/shmmax!
# echo 20446744073692774399 > /proc/sys/kernel/shmmax
But most people edit /etc/sysctl.conf with a line similar to:
kernel.shmmax=your_new_value_here
See the sysctl(8) man page.
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
add a comment |Â
up vote
0
down vote
up vote
0
down vote
On the fly you can just echo into /proc/sys/kernel/shmmax!
# echo 20446744073692774399 > /proc/sys/kernel/shmmax
But most people edit /etc/sysctl.conf with a line similar to:
kernel.shmmax=your_new_value_here
See the sysctl(8) man page.
On the fly you can just echo into /proc/sys/kernel/shmmax!
# echo 20446744073692774399 > /proc/sys/kernel/shmmax
But most people edit /etc/sysctl.conf with a line similar to:
kernel.shmmax=your_new_value_here
See the sysctl(8) man page.
answered Jun 14 '17 at 1:47
Deathgrip
1,266311
1,266311
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
add a comment |Â
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
â Evan Carroll
Jun 14 '17 at 2:09
1
1
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).
â Deathgrip
Jun 14 '17 at 2:48
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f370985%2fwhere-does-linux-set-the-default-values-for-shmmax%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password