diff options
| author | Eric Miao <eric.miao@marvell.com> | 2009-03-09 21:21:07 +0800 |
|---|---|---|
| committer | Eric Miao <eric.miao@marvell.com> | 2009-03-09 21:21:07 +0800 |
| commit | abcea2c322cef559ef2f108b4763d107a5ccc37f (patch) | |
| tree | 5fec7fec372f9bdb70703f6c77bfc49cda945442 /ipc/shm.c | |
| parent | 8118aea23c328fd4913b325af53fda9d530b1d56 (diff) | |
| parent | 6d831c6554e4f95083919914955a1a3a4a6acfa9 (diff) | |
Merge branch 'devel' of ssh://master.kernel.org/home/rmk/linux-2.6-arm into devel
Diffstat (limited to 'ipc/shm.c')
| -rw-r--r-- | ipc/shm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ipc/shm.c b/ipc/shm.c index a9e09ad2263e..f8f69fad3a27 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -368,14 +368,14 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) file = hugetlb_file_setup(name, size); shp->mlock_user = current_user(); } else { - int acctflag = VM_ACCOUNT; + int acctflag = 0; /* * Do not allow no accounting for OVERCOMMIT_NEVER, even * if it's asked for. */ if ((shmflg & SHM_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER) - acctflag = 0; + acctflag = VM_NORESERVE; file = shmem_file_setup(name, size, acctflag); } error = PTR_ERR(file); @@ -565,11 +565,15 @@ static void shm_get_stat(struct ipc_namespace *ns, unsigned long *rss, struct hstate *h = hstate_file(shp->shm_file); *rss += pages_per_huge_page(h) * mapping->nrpages; } else { +#ifdef CONFIG_SHMEM struct shmem_inode_info *info = SHMEM_I(inode); spin_lock(&info->lock); *rss += inode->i_mapping->nrpages; *swp += info->swapped; spin_unlock(&info->lock); +#else + *rss += inode->i_mapping->nrpages; +#endif } total++; |
