Signed-off-by: Badari Pulavarty --- linux-2.6.14-rc3.org/include/linux/shm.h 2005-10-18 08:44:28.000000000 -0700 +++ linux-2.6.14-rc3/include/linux/shm.h 2005-10-18 08:46:03.000000000 -0700 @@ -92,6 +92,7 @@ struct shmid_kernel /* private to the ke #define SHM_DEST 01000 /* segment will be destroyed on last detach */ #define SHM_LOCKED 02000 /* segment will not be swapped */ #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ +#define SHM_NORESERVE 010000 /* don't check for reservations */ #ifdef CONFIG_SYSVIPC long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); --- linux-2.6.14-rc3.org/ipc/shm.c 2005-10-17 16:57:40.000000000 -0700 +++ linux-2.6.14-rc3/ipc/shm.c 2005-10-18 08:55:50.000000000 -0700 @@ -212,8 +212,16 @@ static int newseg (key_t key, int shmflg file = hugetlb_zero_setup(size); shp->mlock_user = current->user; } else { + int acctflag = VM_ACCOUNT; + /* + * Do not allow no accouting for OVERCOMMIT_NEVER, even + * its asked for. + */ + if ((shmflg & SHM_NORESERVE) && + sysctl_overcommit_memory != OVERCOMMIT_NEVER) + acctflag = 0; sprintf (name, "SYSV%08x", key); - file = shmem_file_setup(name, size, VM_ACCOUNT); + file = shmem_file_setup(name, size, acctflag); } error = PTR_ERR(file); if (IS_ERR(file))