Where does Linux set the default values for SHMMAX?
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
.