]> Git Repo - linux.git/commitdiff
ipc: sysv shared memory limited to 8TiB
authorRobin Holt <[email protected]>
Wed, 1 May 2013 02:15:54 +0000 (19:15 -0700)
committerLinus Torvalds <[email protected]>
Wed, 1 May 2013 15:12:58 +0000 (08:12 -0700)
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;

[[email protected]: make ipc/shm.c:newseg()'s numpages size_t, not int]
Signed-off-by: Robin Holt <[email protected]>
Reported-by: Alex Thorlton <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/ipc_namespace.h
ipc/shm.c

index ae221a7b509237a649e8ccfed988265e22f07fa5..c4d870b0d5e6e26580bfd717d64489fce8d59aa6 100644 (file)
@@ -43,8 +43,8 @@ struct ipc_namespace {
 
        size_t          shm_ctlmax;
        size_t          shm_ctlall;
+       unsigned long   shm_tot;
        int             shm_ctlmni;
-       int             shm_tot;
        /*
         * Defines whether IPC_RMID is forced for _all_ shm segments regardless
         * of shmctl()
index cb858df061d37185cf96b7dadd6fe8d5d3e2b869..8247c49ec073c236d183ead9f51ab1f4b3779337 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -462,7 +462,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
        size_t size = params->u.size;
        int error;
        struct shmid_kernel *shp;
-       int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
+       size_t numpages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
        struct file * file;
        char name[13];
        int id;
This page took 0.057397 seconds and 4 git commands to generate.