• Robin Holt's avatar
    ipc: sysv shared memory limited to 8TiB · d69f3bad
    Robin Holt authored
    Trying to run an application which was trying to put data into half of
    memory using shmget(), we found that having a shmall value below 8EiB-8TiB
    would prevent us from using anything more than 8TiB.  By setting
    kernel.shmall greater than 8EiB-8TiB would make the job work.
    
    In the newseg() function, ns->shm_tot which, at 8TiB is INT_MAX.
    
    ipc/shm.c:
     458 static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
     459 {
    ...
     465         int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
    ...
     474         if (ns->shm_tot + numpages > ns->shm_ctlall)
     475                 return -ENOSPC;
    
    [akpm@linux-foundation.org: make ipc/shm.c:newseg()'s numpages size_t, not int]
    Signed-off-by: default avatarRobin Holt <holt@sgi.com>
    Reported-by: default avatarAlex Thorlton <athorlton@sgi.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d69f3bad
shm.c 29.9 KB