summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@virtuozzo.com>2016-01-14 18:18:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:00:49 -0500
commit5d097056c9a017a3b720849efb5432f37acabbac (patch)
treee960a2513a789101097e97cfda27b247ef8650eb
parent37f08dda29dac8a595999b8d3eaa9bf0f763dd9d (diff)
kmemcg: account certain kmem allocations to memcg
Mark those kmem allocations that are known to be easily triggered from userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them accounted to memcg. For the list, see below: - threadinfo - task_struct - task_delay_info - pid - cred - mm_struct - vm_area_struct and vm_region (nommu) - anon_vma and anon_vma_chain - signal_struct - sighand_struct - fs_struct - files_struct - fdtable and fdtable->full_fds_bits - dentry and external_name - inode for all filesystems. This is the most tedious part, because most filesystems overwrite the alloc_inode method. The list is far from complete, so feel free to add more objects. Nevertheless, it should be close to "account everything" approach and keep most workloads within bounds. Malevolent users will be able to breach the limit, but this was possible even with the former "account everything" approach (simply because it did not account everything in fact). [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Tejun Heo <tj@kernel.org> Cc: Greg Thelen <gthelen@google.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/super25.c3
-rw-r--r--fs/9p/v9fs.c2
-rw-r--r--fs/adfs/super.c2
-rw-r--r--fs/affs/super.c2
-rw-r--r--fs/afs/super.c2
-rw-r--r--fs/befs/linuxvfs.c2
-rw-r--r--fs/bfs/inode.c2
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/btrfs/inode.c3
-rw-r--r--fs/ceph/super.c4
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/coda/inode.c6
-rw-r--r--fs/dcache.c5
-rw-r--r--fs/ecryptfs/main.c6
-rw-r--r--fs/efs/super.c6
-rw-r--r--fs/exofs/super.c4
-rw-r--r--fs/ext2/super.c2
-rw-r--r--fs/ext4/super.c2
-rw-r--r--fs/f2fs/super.c5
-rw-r--r--fs/fat/inode.c2
-rw-r--r--fs/file.c7
-rw-r--r--fs/fuse/inode.c4
-rw-r--r--fs/gfs2/main.c3
-rw-r--r--fs/hfs/super.c4
-rw-r--r--fs/hfsplus/super.c2
-rw-r--r--fs/hostfs/hostfs_kern.c2
-rw-r--r--fs/hpfs/super.c2
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/inode.c2
-rw-r--r--fs/isofs/inode.c2
-rw-r--r--fs/jffs2/super.c2
-rw-r--r--fs/jfs/super.c2
-rw-r--r--fs/logfs/inode.c3
-rw-r--r--fs/minix/inode.c2
-rw-r--r--fs/ncpfs/inode.c2
-rw-r--r--fs/nfs/inode.c2
-rw-r--r--fs/nilfs2/super.c3
-rw-r--r--fs/ntfs/super.c4
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c2
-rw-r--r--fs/ocfs2/super.c2
-rw-r--r--fs/openpromfs/inode.c2
-rw-r--r--fs/proc/inode.c3
-rw-r--r--fs/qnx4/inode.c2
-rw-r--r--fs/qnx6/inode.c2
-rw-r--r--fs/reiserfs/super.c3
-rw-r--r--fs/romfs/super.c4
-rw-r--r--fs/squashfs/super.c3
-rw-r--r--fs/sysv/inode.c2
-rw-r--r--fs/ubifs/super.c4
-rw-r--r--fs/udf/super.c3
-rw-r--r--fs/ufs/super.c2
-rw-r--r--fs/xfs/kmem.h1
-rw-r--r--fs/xfs/xfs_super.c4
-rw-r--r--include/linux/thread_info.h5
-rw-r--r--ipc/mqueue.c2
-rw-r--r--kernel/cred.c4
-rw-r--r--kernel/delayacct.c2
-rw-r--r--kernel/fork.c22
-rw-r--r--kernel/pid.c2
-rw-r--r--mm/nommu.c2
-rw-r--r--mm/rmap.c6
-rw-r--r--mm/shmem.c2
-rw-r--r--net/socket.c2
-rw-r--r--net/sunrpc/rpc_pipe.c2
65 files changed, 114 insertions, 92 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 11634fa7ab3c..ad4840f86be1 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -767,7 +767,7 @@ static int __init spufs_init(void)
767 ret = -ENOMEM; 767 ret = -ENOMEM;
768 spufs_inode_cache = kmem_cache_create("spufs_inode_cache", 768 spufs_inode_cache = kmem_cache_create("spufs_inode_cache",
769 sizeof(struct spufs_inode_info), 0, 769 sizeof(struct spufs_inode_info), 0,
770 SLAB_HWCACHE_ALIGN, spufs_init_once); 770 SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, spufs_init_once);
771 771
772 if (!spufs_inode_cache) 772 if (!spufs_inode_cache)
773 goto out; 773 goto out;
diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c
index 7a9fafc67693..86c371ef71ea 100644
--- a/drivers/staging/lustre/lustre/llite/super25.c
+++ b/drivers/staging/lustre/lustre/llite/super25.c
@@ -106,7 +106,8 @@ static int __init init_lustre_lite(void)
106 rc = -ENOMEM; 106 rc = -ENOMEM;
107 ll_inode_cachep = kmem_cache_create("lustre_inode_cache", 107 ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
108 sizeof(struct ll_inode_info), 108 sizeof(struct ll_inode_info),
109 0, SLAB_HWCACHE_ALIGN, NULL); 109 0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
110 NULL);
110 if (ll_inode_cachep == NULL) 111 if (ll_inode_cachep == NULL)
111 goto out_cache; 112 goto out_cache;
112 113
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 6caca025019d..072e7599583a 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -575,7 +575,7 @@ static int v9fs_init_inode_cache(void)
575 v9fs_inode_cache = kmem_cache_create("v9fs_inode_cache", 575 v9fs_inode_cache = kmem_cache_create("v9fs_inode_cache",
576 sizeof(struct v9fs_inode), 576 sizeof(struct v9fs_inode),
577 0, (SLAB_RECLAIM_ACCOUNT| 577 0, (SLAB_RECLAIM_ACCOUNT|
578 SLAB_MEM_SPREAD), 578 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
579 v9fs_inode_init_once); 579 v9fs_inode_init_once);
580 if (!v9fs_inode_cache) 580 if (!v9fs_inode_cache)
581 return -ENOMEM; 581 return -ENOMEM;
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 4d4a0df8344f..c9fdfb112933 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -271,7 +271,7 @@ static int __init init_inodecache(void)
271 adfs_inode_cachep = kmem_cache_create("adfs_inode_cache", 271 adfs_inode_cachep = kmem_cache_create("adfs_inode_cache",
272 sizeof(struct adfs_inode_info), 272 sizeof(struct adfs_inode_info),
273 0, (SLAB_RECLAIM_ACCOUNT| 273 0, (SLAB_RECLAIM_ACCOUNT|
274 SLAB_MEM_SPREAD), 274 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
275 init_once); 275 init_once);
276 if (adfs_inode_cachep == NULL) 276 if (adfs_inode_cachep == NULL)
277 return -ENOMEM; 277 return -ENOMEM;
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 8836df5f1e11..2a6713b6b9f4 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -132,7 +132,7 @@ static int __init init_inodecache(void)
132 affs_inode_cachep = kmem_cache_create("affs_inode_cache", 132 affs_inode_cachep = kmem_cache_create("affs_inode_cache",
133 sizeof(struct affs_inode_info), 133 sizeof(struct affs_inode_info),
134 0, (SLAB_RECLAIM_ACCOUNT| 134 0, (SLAB_RECLAIM_ACCOUNT|
135 SLAB_MEM_SPREAD), 135 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
136 init_once); 136 init_once);
137 if (affs_inode_cachep == NULL) 137 if (affs_inode_cachep == NULL)
138 return -ENOMEM; 138 return -ENOMEM;
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 1fb4a5129f7d..81afefe7d8a6 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -91,7 +91,7 @@ int __init afs_fs_init(void)
91 afs_inode_cachep = kmem_cache_create("afs_inode_cache", 91 afs_inode_cachep = kmem_cache_create("afs_inode_cache",
92 sizeof(struct afs_vnode), 92 sizeof(struct afs_vnode),
93 0, 93 0,
94 SLAB_HWCACHE_ALIGN, 94 SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
95 afs_i_init_once); 95 afs_i_init_once);
96 if (!afs_inode_cachep) { 96 if (!afs_inode_cachep) {
97 printk(KERN_NOTICE "kAFS: Failed to allocate inode cache\n"); 97 printk(KERN_NOTICE "kAFS: Failed to allocate inode cache\n");
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 25250fa87086..cc0e08252913 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -434,7 +434,7 @@ befs_init_inodecache(void)
434 befs_inode_cachep = kmem_cache_create("befs_inode_cache", 434 befs_inode_cachep = kmem_cache_create("befs_inode_cache",
435 sizeof (struct befs_inode_info), 435 sizeof (struct befs_inode_info),
436 0, (SLAB_RECLAIM_ACCOUNT| 436 0, (SLAB_RECLAIM_ACCOUNT|
437 SLAB_MEM_SPREAD), 437 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
438 init_once); 438 init_once);
439 if (befs_inode_cachep == NULL) { 439 if (befs_inode_cachep == NULL) {
440 pr_err("%s: Couldn't initialize inode slabcache\n", __func__); 440 pr_err("%s: Couldn't initialize inode slabcache\n", __func__);
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index fdcb4d69f430..1e5c896f6b79 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -270,7 +270,7 @@ static int __init init_inodecache(void)
270 bfs_inode_cachep = kmem_cache_create("bfs_inode_cache", 270 bfs_inode_cachep = kmem_cache_create("bfs_inode_cache",
271 sizeof(struct bfs_inode_info), 271 sizeof(struct bfs_inode_info),
272 0, (SLAB_RECLAIM_ACCOUNT| 272 0, (SLAB_RECLAIM_ACCOUNT|
273 SLAB_MEM_SPREAD), 273 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
274 init_once); 274 init_once);
275 if (bfs_inode_cachep == NULL) 275 if (bfs_inode_cachep == NULL)
276 return -ENOMEM; 276 return -ENOMEM;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index d878e4860fb7..d33071dd683e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -595,7 +595,7 @@ void __init bdev_cache_init(void)
595 595
596 bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode), 596 bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
597 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| 597 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
598 SLAB_MEM_SPREAD|SLAB_PANIC), 598 SLAB_MEM_SPREAD|SLAB_ACCOUNT|SLAB_PANIC),
599 init_once); 599 init_once);
600 err = register_filesystem(&bd_type); 600 err = register_filesystem(&bd_type);
601 if (err) 601 if (err)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 3b8856e182ae..394017831692 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9161,7 +9161,8 @@ int btrfs_init_cachep(void)
9161{ 9161{
9162 btrfs_inode_cachep = kmem_cache_create("btrfs_inode", 9162 btrfs_inode_cachep = kmem_cache_create("btrfs_inode",
9163 sizeof(struct btrfs_inode), 0, 9163 sizeof(struct btrfs_inode), 0,
9164 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, init_once); 9164 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT,
9165 init_once);
9165 if (!btrfs_inode_cachep) 9166 if (!btrfs_inode_cachep)
9166 goto fail; 9167 goto fail;
9167 9168
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index f446afada328..ca4d5e8457f1 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -639,8 +639,8 @@ static int __init init_caches(void)
639 ceph_inode_cachep = kmem_cache_create("ceph_inode_info", 639 ceph_inode_cachep = kmem_cache_create("ceph_inode_info",
640 sizeof(struct ceph_inode_info), 640 sizeof(struct ceph_inode_info),
641 __alignof__(struct ceph_inode_info), 641 __alignof__(struct ceph_inode_info),
642 (SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD), 642 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
643 ceph_inode_init_once); 643 SLAB_ACCOUNT, ceph_inode_init_once);
644 if (ceph_inode_cachep == NULL) 644 if (ceph_inode_cachep == NULL)
645 return -ENOMEM; 645 return -ENOMEM;
646 646
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index b7fcb3151103..c4c1169814b2 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -1092,7 +1092,7 @@ cifs_init_inodecache(void)
1092 cifs_inode_cachep = kmem_cache_create("cifs_inode_cache", 1092 cifs_inode_cachep = kmem_cache_create("cifs_inode_cache",
1093 sizeof(struct cifsInodeInfo), 1093 sizeof(struct cifsInodeInfo),
1094 0, (SLAB_RECLAIM_ACCOUNT| 1094 0, (SLAB_RECLAIM_ACCOUNT|
1095 SLAB_MEM_SPREAD), 1095 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1096 cifs_init_once); 1096 cifs_init_once);
1097 if (cifs_inode_cachep == NULL) 1097 if (cifs_inode_cachep == NULL)
1098 return -ENOMEM; 1098 return -ENOMEM;
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index cac1390b87a3..57e81cbba0fa 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -74,9 +74,9 @@ static void init_once(void *foo)
74int __init coda_init_inodecache(void) 74int __init coda_init_inodecache(void)
75{ 75{
76 coda_inode_cachep = kmem_cache_create("coda_inode_cache", 76 coda_inode_cachep = kmem_cache_create("coda_inode_cache",
77 sizeof(struct coda_inode_info), 77 sizeof(struct coda_inode_info), 0,
78 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 78 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
79 init_once); 79 SLAB_ACCOUNT, init_once);
80 if (coda_inode_cachep == NULL) 80 if (coda_inode_cachep == NULL)
81 return -ENOMEM; 81 return -ENOMEM;
82 return 0; 82 return 0;
diff --git a/fs/dcache.c b/fs/dcache.c
index 8d38cd07b207..b4539e84e577 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1571,7 +1571,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
1571 dentry->d_iname[DNAME_INLINE_LEN-1] = 0; 1571 dentry->d_iname[DNAME_INLINE_LEN-1] = 0;
1572 if (name->len > DNAME_INLINE_LEN-1) { 1572 if (name->len > DNAME_INLINE_LEN-1) {
1573 size_t size = offsetof(struct external_name, name[1]); 1573 size_t size = offsetof(struct external_name, name[1]);
1574 struct external_name *p = kmalloc(size + name->len, GFP_KERNEL); 1574 struct external_name *p = kmalloc(size + name->len,
1575 GFP_KERNEL_ACCOUNT);
1575 if (!p) { 1576 if (!p) {
1576 kmem_cache_free(dentry_cache, dentry); 1577 kmem_cache_free(dentry_cache, dentry);
1577 return NULL; 1578 return NULL;
@@ -3415,7 +3416,7 @@ static void __init dcache_init(void)
3415 * of the dcache. 3416 * of the dcache.
3416 */ 3417 */
3417 dentry_cache = KMEM_CACHE(dentry, 3418 dentry_cache = KMEM_CACHE(dentry,
3418 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD); 3419 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT);
3419 3420
3420 /* Hash may have been set up in dcache_init_early */ 3421 /* Hash may have been set up in dcache_init_early */
3421 if (!hashdist) 3422 if (!hashdist)
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 4f4d0474bee9..e25b6b06bacf 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -663,6 +663,7 @@ static struct ecryptfs_cache_info {
663 struct kmem_cache **cache; 663 struct kmem_cache **cache;
664 const char *name; 664 const char *name;
665 size_t size; 665 size_t size;
666 unsigned long flags;
666 void (*ctor)(void *obj); 667 void (*ctor)(void *obj);
667} ecryptfs_cache_infos[] = { 668} ecryptfs_cache_infos[] = {
668 { 669 {
@@ -684,6 +685,7 @@ static struct ecryptfs_cache_info {
684 .cache = &ecryptfs_inode_info_cache, 685 .cache = &ecryptfs_inode_info_cache,
685 .name = "ecryptfs_inode_cache", 686 .name = "ecryptfs_inode_cache",
686 .size = sizeof(struct ecryptfs_inode_info), 687 .size = sizeof(struct ecryptfs_inode_info),
688 .flags = SLAB_ACCOUNT,
687 .ctor = inode_info_init_once, 689 .ctor = inode_info_init_once,
688 }, 690 },
689 { 691 {
@@ -755,8 +757,8 @@ static int ecryptfs_init_kmem_caches(void)
755 struct ecryptfs_cache_info *info; 757 struct ecryptfs_cache_info *info;
756 758
757 info = &ecryptfs_cache_infos[i]; 759 info = &ecryptfs_cache_infos[i];
758 *(info->cache) = kmem_cache_create(info->name, info->size, 760 *(info->cache) = kmem_cache_create(info->name, info->size, 0,
759 0, SLAB_HWCACHE_ALIGN, info->ctor); 761 SLAB_HWCACHE_ALIGN | info->flags, info->ctor);
760 if (!*(info->cache)) { 762 if (!*(info->cache)) {
761 ecryptfs_free_kmem_caches(); 763 ecryptfs_free_kmem_caches();
762 ecryptfs_printk(KERN_WARNING, "%s: " 764 ecryptfs_printk(KERN_WARNING, "%s: "
diff --git a/fs/efs/super.c b/fs/efs/super.c
index c8411a30f7da..cb68dac4f9d3 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -94,9 +94,9 @@ static void init_once(void *foo)
94static int __init init_inodecache(void) 94static int __init init_inodecache(void)
95{ 95{
96 efs_inode_cachep = kmem_cache_create("efs_inode_cache", 96 efs_inode_cachep = kmem_cache_create("efs_inode_cache",
97 sizeof(struct efs_inode_info), 97 sizeof(struct efs_inode_info), 0,
98 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 98 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
99 init_once); 99 SLAB_ACCOUNT, init_once);
100 if (efs_inode_cachep == NULL) 100 if (efs_inode_cachep == NULL)
101 return -ENOMEM; 101 return -ENOMEM;
102 return 0; 102 return 0;
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index b795c567b5e1..6658a50530a0 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -194,8 +194,8 @@ static int init_inodecache(void)
194{ 194{
195 exofs_inode_cachep = kmem_cache_create("exofs_inode_cache", 195 exofs_inode_cachep = kmem_cache_create("exofs_inode_cache",
196 sizeof(struct exofs_i_info), 0, 196 sizeof(struct exofs_i_info), 0,
197 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, 197 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
198 exofs_init_once); 198 SLAB_ACCOUNT, exofs_init_once);
199 if (exofs_inode_cachep == NULL) 199 if (exofs_inode_cachep == NULL)
200 return -ENOMEM; 200 return -ENOMEM;
201 return 0; 201 return 0;
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 748d35afc902..2a188413a2b0 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -203,7 +203,7 @@ static int __init init_inodecache(void)
203 ext2_inode_cachep = kmem_cache_create("ext2_inode_cache", 203 ext2_inode_cachep = kmem_cache_create("ext2_inode_cache",
204 sizeof(struct ext2_inode_info), 204 sizeof(struct ext2_inode_info),
205 0, (SLAB_RECLAIM_ACCOUNT| 205 0, (SLAB_RECLAIM_ACCOUNT|
206 SLAB_MEM_SPREAD), 206 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
207 init_once); 207 init_once);
208 if (ext2_inode_cachep == NULL) 208 if (ext2_inode_cachep == NULL)
209 return -ENOMEM; 209 return -ENOMEM;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c9ab67da6e5a..f1b56ff01208 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -966,7 +966,7 @@ static int __init init_inodecache(void)
966 ext4_inode_cachep = kmem_cache_create("ext4_inode_cache", 966 ext4_inode_cachep = kmem_cache_create("ext4_inode_cache",
967 sizeof(struct ext4_inode_info), 967 sizeof(struct ext4_inode_info),
968 0, (SLAB_RECLAIM_ACCOUNT| 968 0, (SLAB_RECLAIM_ACCOUNT|
969 SLAB_MEM_SPREAD), 969 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
970 init_once); 970 init_once);
971 if (ext4_inode_cachep == NULL) 971 if (ext4_inode_cachep == NULL)
972 return -ENOMEM; 972 return -ENOMEM;
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 3bf990b80026..6134832baaaf 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1541,8 +1541,9 @@ MODULE_ALIAS_FS("f2fs");
1541 1541
1542static int __init init_inodecache(void) 1542static int __init init_inodecache(void)
1543{ 1543{
1544 f2fs_inode_cachep = f2fs_kmem_cache_create("f2fs_inode_cache", 1544 f2fs_inode_cachep = kmem_cache_create("f2fs_inode_cache",
1545 sizeof(struct f2fs_inode_info)); 1545 sizeof(struct f2fs_inode_info), 0,
1546 SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT, NULL);
1546 if (!f2fs_inode_cachep) 1547 if (!f2fs_inode_cachep)
1547 return -ENOMEM; 1548 return -ENOMEM;
1548 return 0; 1549 return 0;
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 509411dd3698..6aece96df19f 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -677,7 +677,7 @@ static int __init fat_init_inodecache(void)
677 fat_inode_cachep = kmem_cache_create("fat_inode_cache", 677 fat_inode_cachep = kmem_cache_create("fat_inode_cache",
678 sizeof(struct msdos_inode_info), 678 sizeof(struct msdos_inode_info),
679 0, (SLAB_RECLAIM_ACCOUNT| 679 0, (SLAB_RECLAIM_ACCOUNT|
680 SLAB_MEM_SPREAD), 680 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
681 init_once); 681 init_once);
682 if (fat_inode_cachep == NULL) 682 if (fat_inode_cachep == NULL)
683 return -ENOMEM; 683 return -ENOMEM;
diff --git a/fs/file.c b/fs/file.c
index 1aed0add16a2..1fbc5c0555a9 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -37,11 +37,12 @@ static void *alloc_fdmem(size_t size)
37 * vmalloc() if the allocation size will be considered "large" by the VM. 37 * vmalloc() if the allocation size will be considered "large" by the VM.
38 */ 38 */
39 if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) { 39 if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
40 void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY); 40 void *data = kmalloc(size, GFP_KERNEL_ACCOUNT |
41 __GFP_NOWARN | __GFP_NORETRY);
41 if (data != NULL) 42 if (data != NULL)
42 return data; 43 return data;
43 } 44 }
44 return vmalloc(size); 45 return __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM, PAGE_KERNEL);
45} 46}
46 47
47static void __free_fdtable(struct fdtable *fdt) 48static void __free_fdtable(struct fdtable *fdt)
@@ -126,7 +127,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
126 if (unlikely(nr > sysctl_nr_open)) 127 if (unlikely(nr > sysctl_nr_open))
127 nr = ((sysctl_nr_open - 1) | (BITS_PER_LONG - 1)) + 1; 128 nr = ((sysctl_nr_open - 1) | (BITS_PER_LONG - 1)) + 1;
128 129
129 fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL); 130 fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL_ACCOUNT);
130 if (!fdt) 131 if (!fdt)
131 goto out; 132 goto out;
132 fdt->max_fds = nr; 133 fdt->max_fds = nr;
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 2913db2a5b99..4d69d5c0bedc 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1255,8 +1255,8 @@ static int __init fuse_fs_init(void)
1255 int err; 1255 int err;
1256 1256
1257 fuse_inode_cachep = kmem_cache_create("fuse_inode", 1257 fuse_inode_cachep = kmem_cache_create("fuse_inode",
1258 sizeof(struct fuse_inode), 1258 sizeof(struct fuse_inode), 0,
1259 0, SLAB_HWCACHE_ALIGN, 1259 SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
1260 fuse_inode_init_once); 1260 fuse_inode_init_once);
1261 err = -ENOMEM; 1261 err = -ENOMEM;
1262 if (!fuse_inode_cachep) 1262 if (!fuse_inode_cachep)
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 1d709d496364..f99f8e94de3f 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -114,7 +114,8 @@ static int __init init_gfs2_fs(void)
114 gfs2_inode_cachep = kmem_cache_create("gfs2_inode", 114 gfs2_inode_cachep = kmem_cache_create("gfs2_inode",
115 sizeof(struct gfs2_inode), 115 sizeof(struct gfs2_inode),
116 0, SLAB_RECLAIM_ACCOUNT| 116 0, SLAB_RECLAIM_ACCOUNT|
117 SLAB_MEM_SPREAD, 117 SLAB_MEM_SPREAD|
118 SLAB_ACCOUNT,
118 gfs2_init_inode_once); 119 gfs2_init_inode_once);
119 if (!gfs2_inode_cachep) 120 if (!gfs2_inode_cachep)
120 goto fail; 121 goto fail;
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 4574fdd3d421..1ca95c232bb5 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -483,8 +483,8 @@ static int __init init_hfs_fs(void)
483 int err; 483 int err;
484 484
485 hfs_inode_cachep = kmem_cache_create("hfs_inode_cache", 485 hfs_inode_cachep = kmem_cache_create("hfs_inode_cache",
486 sizeof(struct hfs_inode_info), 0, SLAB_HWCACHE_ALIGN, 486 sizeof(struct hfs_inode_info), 0,
487 hfs_init_once); 487 SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, hfs_init_once);
488 if (!hfs_inode_cachep) 488 if (!hfs_inode_cachep)
489 return -ENOMEM; 489 return -ENOMEM;
490 err = register_filesystem(&hfs_fs_type); 490 err = register_filesystem(&hfs_fs_type);
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 7302d96ae8bf..5d54490a136d 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -663,7 +663,7 @@ static int __init init_hfsplus_fs(void)
663 int err; 663 int err;
664 664
665 hfsplus_inode_cachep = kmem_cache_create("hfsplus_icache", 665 hfsplus_inode_cachep = kmem_cache_create("hfsplus_icache",
666 HFSPLUS_INODE_SIZE, 0, SLAB_HWCACHE_ALIGN, 666 HFSPLUS_INODE_SIZE, 0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
667 hfsplus_init_once); 667 hfsplus_init_once);
668 if (!hfsplus_inode_cachep) 668 if (!hfsplus_inode_cachep)
669 return -ENOMEM; 669 return -ENOMEM;
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index f49be23e78aa..cfaa18c7a337 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -223,7 +223,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
223{ 223{
224 struct hostfs_inode_info *hi; 224 struct hostfs_inode_info *hi;
225 225
226 hi = kmalloc(sizeof(*hi), GFP_KERNEL); 226 hi = kmalloc(sizeof(*hi), GFP_KERNEL_ACCOUNT);
227 if (hi == NULL) 227 if (hi == NULL)
228 return NULL; 228 return NULL;
229 hi->fd = -1; 229 hi->fd = -1;
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index a561591896bd..458cf463047b 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -261,7 +261,7 @@ static int init_inodecache(void)
261 hpfs_inode_cachep = kmem_cache_create("hpfs_inode_cache", 261 hpfs_inode_cachep = kmem_cache_create("hpfs_inode_cache",
262 sizeof(struct hpfs_inode_info), 262 sizeof(struct hpfs_inode_info),
263 0, (SLAB_RECLAIM_ACCOUNT| 263 0, (SLAB_RECLAIM_ACCOUNT|
264 SLAB_MEM_SPREAD), 264 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
265 init_once); 265 init_once);
266 if (hpfs_inode_cachep == NULL) 266 if (hpfs_inode_cachep == NULL)
267 return -ENOMEM; 267 return -ENOMEM;
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index d8f51ee8126b..f6820ecf0a11 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -1322,7 +1322,7 @@ static int __init init_hugetlbfs_fs(void)
1322 error = -ENOMEM; 1322 error = -ENOMEM;
1323 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache", 1323 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
1324 sizeof(struct hugetlbfs_inode_info), 1324 sizeof(struct hugetlbfs_inode_info),
1325 0, 0, init_once); 1325 0, SLAB_ACCOUNT, init_once);
1326 if (hugetlbfs_inode_cachep == NULL) 1326 if (hugetlbfs_inode_cachep == NULL)
1327 goto out2; 1327 goto out2;
1328 1328
diff --git a/fs/inode.c b/fs/inode.c
index 4230f66b7410..e491e54d2430 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1883,7 +1883,7 @@ void __init inode_init(void)
1883 sizeof(struct inode), 1883 sizeof(struct inode),
1884 0, 1884 0,
1885 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 1885 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
1886 SLAB_MEM_SPREAD), 1886 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1887 init_once); 1887 init_once);
1888 1888
1889 /* Hash may have been set up in inode_init_early */ 1889 /* Hash may have been set up in inode_init_early */
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 61abdc4920da..bcd2d41b318a 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -94,7 +94,7 @@ static int __init init_inodecache(void)
94 isofs_inode_cachep = kmem_cache_create("isofs_inode_cache", 94 isofs_inode_cachep = kmem_cache_create("isofs_inode_cache",
95 sizeof(struct iso_inode_info), 95 sizeof(struct iso_inode_info),
96 0, (SLAB_RECLAIM_ACCOUNT| 96 0, (SLAB_RECLAIM_ACCOUNT|
97 SLAB_MEM_SPREAD), 97 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
98 init_once); 98 init_once);
99 if (isofs_inode_cachep == NULL) 99 if (isofs_inode_cachep == NULL)
100 return -ENOMEM; 100 return -ENOMEM;
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index d86c5e3176a1..bb080c272149 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -387,7 +387,7 @@ static int __init init_jffs2_fs(void)
387 jffs2_inode_cachep = kmem_cache_create("jffs2_i", 387 jffs2_inode_cachep = kmem_cache_create("jffs2_i",
388 sizeof(struct jffs2_inode_info), 388 sizeof(struct jffs2_inode_info),
389 0, (SLAB_RECLAIM_ACCOUNT| 389 0, (SLAB_RECLAIM_ACCOUNT|
390 SLAB_MEM_SPREAD), 390 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
391 jffs2_i_init_once); 391 jffs2_i_init_once);
392 if (!jffs2_inode_cachep) { 392 if (!jffs2_inode_cachep) {
393 pr_err("error: Failed to initialise inode cache\n"); 393 pr_err("error: Failed to initialise inode cache\n");
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 8f9176caf098..900925b5eb8c 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -898,7 +898,7 @@ static int __init init_jfs_fs(void)
898 898
899 jfs_inode_cachep = 899 jfs_inode_cachep =
900 kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0, 900 kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
901 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 901 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT,
902 init_once); 902 init_once);
903 if (jfs_inode_cachep == NULL) 903 if (jfs_inode_cachep == NULL)
904 return -ENOMEM; 904 return -ENOMEM;
diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c
index 0fce46d62b9c..db9cfc598883 100644
--- a/fs/logfs/inode.c
+++ b/fs/logfs/inode.c
@@ -409,7 +409,8 @@ const struct super_operations logfs_super_operations = {
409int logfs_init_inode_cache(void) 409int logfs_init_inode_cache(void)
410{ 410{
411 logfs_inode_cache = kmem_cache_create("logfs_inode_cache", 411 logfs_inode_cache = kmem_cache_create("logfs_inode_cache",
412 sizeof(struct logfs_inode), 0, SLAB_RECLAIM_ACCOUNT, 412 sizeof(struct logfs_inode), 0,
413 SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
413 logfs_init_once); 414 logfs_init_once);
414 if (!logfs_inode_cache) 415 if (!logfs_inode_cache)
415 return -ENOMEM; 416 return -ENOMEM;
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index cb1789ca1ee6..f975d667c539 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -91,7 +91,7 @@ static int __init init_inodecache(void)
91 minix_inode_cachep = kmem_cache_create("minix_inode_cache", 91 minix_inode_cachep = kmem_cache_create("minix_inode_cache",
92 sizeof(struct minix_inode_info), 92 sizeof(struct minix_inode_info),
93 0, (SLAB_RECLAIM_ACCOUNT| 93 0, (SLAB_RECLAIM_ACCOUNT|
94 SLAB_MEM_SPREAD), 94 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
95 init_once); 95 init_once);
96 if (minix_inode_cachep == NULL) 96 if (minix_inode_cachep == NULL)
97 return -ENOMEM; 97 return -ENOMEM;
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index ce1eb3f9dfe8..1af15fcbe57b 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -82,7 +82,7 @@ static int init_inodecache(void)
82 ncp_inode_cachep = kmem_cache_create("ncp_inode_cache", 82 ncp_inode_cachep = kmem_cache_create("ncp_inode_cache",
83 sizeof(struct ncp_inode_info), 83 sizeof(struct ncp_inode_info),
84 0, (SLAB_RECLAIM_ACCOUNT| 84 0, (SLAB_RECLAIM_ACCOUNT|
85 SLAB_MEM_SPREAD), 85 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
86 init_once); 86 init_once);
87 if (ncp_inode_cachep == NULL) 87 if (ncp_inode_cachep == NULL)
88 return -ENOMEM; 88 return -ENOMEM;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index bdb4dc7b4ecd..48fd8a87affe 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1933,7 +1933,7 @@ static int __init nfs_init_inodecache(void)
1933 nfs_inode_cachep = kmem_cache_create("nfs_inode_cache", 1933 nfs_inode_cachep = kmem_cache_create("nfs_inode_cache",
1934 sizeof(struct nfs_inode), 1934 sizeof(struct nfs_inode),
1935 0, (SLAB_RECLAIM_ACCOUNT| 1935 0, (SLAB_RECLAIM_ACCOUNT|
1936 SLAB_MEM_SPREAD), 1936 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1937 init_once); 1937 init_once);
1938 if (nfs_inode_cachep == NULL) 1938 if (nfs_inode_cachep == NULL)
1939 return -ENOMEM; 1939 return -ENOMEM;
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index c7343844e6b6..7f5d3d9f1c37 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1416,7 +1416,8 @@ static int __init nilfs_init_cachep(void)
1416{ 1416{
1417 nilfs_inode_cachep = kmem_cache_create("nilfs2_inode_cache", 1417 nilfs_inode_cachep = kmem_cache_create("nilfs2_inode_cache",
1418 sizeof(struct nilfs_inode_info), 0, 1418 sizeof(struct nilfs_inode_info), 0,
1419 SLAB_RECLAIM_ACCOUNT, nilfs_inode_init_once); 1419 SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
1420 nilfs_inode_init_once);
1420 if (!nilfs_inode_cachep) 1421 if (!nilfs_inode_cachep)
1421 goto fail; 1422 goto fail;
1422 1423
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index d1a853585b53..2f77f8dfb861 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -3139,8 +3139,8 @@ static int __init init_ntfs_fs(void)
3139 3139
3140 ntfs_big_inode_cache = kmem_cache_create(ntfs_big_inode_cache_name, 3140 ntfs_big_inode_cache = kmem_cache_create(ntfs_big_inode_cache_name,
3141 sizeof(big_ntfs_inode), 0, 3141 sizeof(big_ntfs_inode), 0,
3142 SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 3142 SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
3143 ntfs_big_inode_init_once); 3143 SLAB_ACCOUNT, ntfs_big_inode_init_once);
3144 if (!ntfs_big_inode_cache) { 3144 if (!ntfs_big_inode_cache) {
3145 pr_crit("Failed to create %s!\n", ntfs_big_inode_cache_name); 3145 pr_crit("Failed to create %s!\n", ntfs_big_inode_cache_name);
3146 goto big_inode_err_out; 3146 goto big_inode_err_out;
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index b5cf27dcb18a..03768bb3aab1 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -638,7 +638,7 @@ static int __init init_dlmfs_fs(void)
638 dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache", 638 dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache",
639 sizeof(struct dlmfs_inode_private), 639 sizeof(struct dlmfs_inode_private),
640 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| 640 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
641 SLAB_MEM_SPREAD), 641 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
642 dlmfs_init_once); 642 dlmfs_init_once);
643 if (!dlmfs_inode_cache) { 643 if (!dlmfs_inode_cache) {
644 status = -ENOMEM; 644 status = -ENOMEM;
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c62d761d6bf0..faa1365097bc 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1766,7 +1766,7 @@ static int ocfs2_initialize_mem_caches(void)
1766 sizeof(struct ocfs2_inode_info), 1766 sizeof(struct ocfs2_inode_info),
1767 0, 1767 0,
1768 (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| 1768 (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
1769 SLAB_MEM_SPREAD), 1769 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1770 ocfs2_inode_init_once); 1770 ocfs2_inode_init_once);
1771 ocfs2_dquot_cachep = kmem_cache_create("ocfs2_dquot_cache", 1771 ocfs2_dquot_cachep = kmem_cache_create("ocfs2_dquot_cache",
1772 sizeof(struct ocfs2_dquot), 1772 sizeof(struct ocfs2_dquot),
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 15e4500cda3e..b61b883c8ff8 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -443,7 +443,7 @@ static int __init init_openprom_fs(void)
443 sizeof(struct op_inode_info), 443 sizeof(struct op_inode_info),
444 0, 444 0,
445 (SLAB_RECLAIM_ACCOUNT | 445 (SLAB_RECLAIM_ACCOUNT |
446 SLAB_MEM_SPREAD), 446 SLAB_MEM_SPREAD | SLAB_ACCOUNT),
447 op_inode_init_once); 447 op_inode_init_once);
448 if (!op_inode_cachep) 448 if (!op_inode_cachep)
449 return -ENOMEM; 449 return -ENOMEM;
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index d0e9b9b6223e..42305ddcbaa0 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -95,7 +95,8 @@ void __init proc_init_inodecache(void)
95 proc_inode_cachep = kmem_cache_create("proc_inode_cache", 95 proc_inode_cachep = kmem_cache_create("proc_inode_cache",
96 sizeof(struct proc_inode), 96 sizeof(struct proc_inode),
97 0, (SLAB_RECLAIM_ACCOUNT| 97 0, (SLAB_RECLAIM_ACCOUNT|
98 SLAB_MEM_SPREAD|SLAB_PANIC), 98 SLAB_MEM_SPREAD|SLAB_ACCOUNT|
99 SLAB_PANIC),
99 init_once); 100 init_once);
100} 101}
101 102
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index f37b3deb01b4..3a67cfb142d8 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -365,7 +365,7 @@ static int init_inodecache(void)
365 qnx4_inode_cachep = kmem_cache_create("qnx4_inode_cache", 365 qnx4_inode_cachep = kmem_cache_create("qnx4_inode_cache",
366 sizeof(struct qnx4_inode_info), 366 sizeof(struct qnx4_inode_info),
367 0, (SLAB_RECLAIM_ACCOUNT| 367 0, (SLAB_RECLAIM_ACCOUNT|
368 SLAB_MEM_SPREAD), 368 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
369 init_once); 369 init_once);
370 if (qnx4_inode_cachep == NULL) 370 if (qnx4_inode_cachep == NULL)
371 return -ENOMEM; 371 return -ENOMEM;
diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 9728b5499e1d..47bb1de07155 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -625,7 +625,7 @@ static int init_inodecache(void)
625 qnx6_inode_cachep = kmem_cache_create("qnx6_inode_cache", 625 qnx6_inode_cachep = kmem_cache_create("qnx6_inode_cache",
626 sizeof(struct qnx6_inode_info), 626 sizeof(struct qnx6_inode_info),
627 0, (SLAB_RECLAIM_ACCOUNT| 627 0, (SLAB_RECLAIM_ACCOUNT|
628 SLAB_MEM_SPREAD), 628 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
629 init_once); 629 init_once);
630 if (!qnx6_inode_cachep) 630 if (!qnx6_inode_cachep)
631 return -ENOMEM; 631 return -ENOMEM;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 4a62fe8cc3bf..05db7473bcb5 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -626,7 +626,8 @@ static int __init init_inodecache(void)
626 sizeof(struct 626 sizeof(struct
627 reiserfs_inode_info), 627 reiserfs_inode_info),
628 0, (SLAB_RECLAIM_ACCOUNT| 628 0, (SLAB_RECLAIM_ACCOUNT|
629 SLAB_MEM_SPREAD), 629 SLAB_MEM_SPREAD|
630 SLAB_ACCOUNT),
630 init_once); 631 init_once);
631 if (reiserfs_inode_cachep == NULL) 632 if (reiserfs_inode_cachep == NULL)
632 return -ENOMEM; 633 return -ENOMEM;
diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index bb894e78a821..6b00ca357c58 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -619,8 +619,8 @@ static int __init init_romfs_fs(void)
619 romfs_inode_cachep = 619 romfs_inode_cachep =
620 kmem_cache_create("romfs_i", 620 kmem_cache_create("romfs_i",
621 sizeof(struct romfs_inode_info), 0, 621 sizeof(struct romfs_inode_info), 0,
622 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, 622 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
623 romfs_i_init_once); 623 SLAB_ACCOUNT, romfs_i_init_once);
624 624
625 if (!romfs_inode_cachep) { 625 if (!romfs_inode_cachep) {
626 pr_err("Failed to initialise inode cache\n"); 626 pr_err("Failed to initialise inode cache\n");
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index dded920cbc8f..5e79bfa4f260 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -419,7 +419,8 @@ static int __init init_inodecache(void)
419{ 419{
420 squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache", 420 squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache",
421 sizeof(struct squashfs_inode_info), 0, 421 sizeof(struct squashfs_inode_info), 0,
422 SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, init_once); 422 SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
423 init_once);
423 424
424 return squashfs_inode_cachep ? 0 : -ENOMEM; 425 return squashfs_inode_cachep ? 0 : -ENOMEM;
425} 426}
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 07ac18c355e7..d62c423a5a2d 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -346,7 +346,7 @@ int __init sysv_init_icache(void)
346{ 346{
347 sysv_inode_cachep = kmem_cache_create("sysv_inode_cache", 347 sysv_inode_cachep = kmem_cache_create("sysv_inode_cache",
348 sizeof(struct sysv_inode_info), 0, 348 sizeof(struct sysv_inode_info), 0,
349 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 349 SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT,
350 init_once); 350 init_once);
351 if (!sysv_inode_cachep) 351 if (!sysv_inode_cachep)
352 return -ENOMEM; 352 return -ENOMEM;
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 1fd90c079537..a233ba913be4 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2248,8 +2248,8 @@ static int __init ubifs_init(void)
2248 2248
2249 ubifs_inode_slab = kmem_cache_create("ubifs_inode_slab", 2249 ubifs_inode_slab = kmem_cache_create("ubifs_inode_slab",
2250 sizeof(struct ubifs_inode), 0, 2250 sizeof(struct ubifs_inode), 0,
2251 SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT, 2251 SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT |
2252 &inode_slab_ctor); 2252 SLAB_ACCOUNT, &inode_slab_ctor);
2253 if (!ubifs_inode_slab) 2253 if (!ubifs_inode_slab)
2254 return -ENOMEM; 2254 return -ENOMEM;
2255 2255
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 81155b9b445b..9c64a3ca9837 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -179,7 +179,8 @@ static int __init init_inodecache(void)
179 udf_inode_cachep = kmem_cache_create("udf_inode_cache", 179 udf_inode_cachep = kmem_cache_create("udf_inode_cache",
180 sizeof(struct udf_inode_info), 180 sizeof(struct udf_inode_info),
181 0, (SLAB_RECLAIM_ACCOUNT | 181 0, (SLAB_RECLAIM_ACCOUNT |
182 SLAB_MEM_SPREAD), 182 SLAB_MEM_SPREAD |
183 SLAB_ACCOUNT),
183 init_once); 184 init_once);
184 if (!udf_inode_cachep) 185 if (!udf_inode_cachep)
185 return -ENOMEM; 186 return -ENOMEM;
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index f6390eec02ca..442fd52ebffe 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1427,7 +1427,7 @@ static int __init init_inodecache(void)
1427 ufs_inode_cachep = kmem_cache_create("ufs_inode_cache", 1427 ufs_inode_cachep = kmem_cache_create("ufs_inode_cache",
1428 sizeof(struct ufs_inode_info), 1428 sizeof(struct ufs_inode_info),
1429 0, (SLAB_RECLAIM_ACCOUNT| 1429 0, (SLAB_RECLAIM_ACCOUNT|
1430 SLAB_MEM_SPREAD), 1430 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1431 init_once); 1431 init_once);
1432 if (ufs_inode_cachep == NULL) 1432 if (ufs_inode_cachep == NULL)
1433 return -ENOMEM; 1433 return -ENOMEM;
diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
index cc6b768fc068..d1c66e465ca5 100644
--- a/fs/xfs/kmem.h
+++ b/fs/xfs/kmem.h
@@ -84,6 +84,7 @@ kmem_zalloc(size_t size, xfs_km_flags_t flags)
84#define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN 84#define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN
85#define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT 85#define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT
86#define KM_ZONE_SPREAD SLAB_MEM_SPREAD 86#define KM_ZONE_SPREAD SLAB_MEM_SPREAD
87#define KM_ZONE_ACCOUNT SLAB_ACCOUNT
87 88
88#define kmem_zone kmem_cache 89#define kmem_zone kmem_cache
89#define kmem_zone_t struct kmem_cache 90#define kmem_zone_t struct kmem_cache
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index b35775752b74..59c9b7bd958d 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1714,8 +1714,8 @@ xfs_init_zones(void)
1714 1714
1715 xfs_inode_zone = 1715 xfs_inode_zone =
1716 kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode", 1716 kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
1717 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD, 1717 KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD |
1718 xfs_fs_inode_init_once); 1718 KM_ZONE_ACCOUNT, xfs_fs_inode_init_once);
1719 if (!xfs_inode_zone) 1719 if (!xfs_inode_zone)
1720 goto out_destroy_efi_zone; 1720 goto out_destroy_efi_zone;
1721 1721
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index ff307b548ed3..b4c2a485b28a 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -56,9 +56,10 @@ extern long do_no_restart_syscall(struct restart_block *parm);
56#ifdef __KERNEL__ 56#ifdef __KERNEL__
57 57
58#ifdef CONFIG_DEBUG_STACK_USAGE 58#ifdef CONFIG_DEBUG_STACK_USAGE
59# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) 59# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \
60 __GFP_ZERO)
60#else 61#else
61# define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK) 62# define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK)
62#endif 63#endif
63 64
64/* 65/*
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 161a1807e6ef..f4617cf07069 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1438,7 +1438,7 @@ static int __init init_mqueue_fs(void)
1438 1438
1439 mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache", 1439 mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache",
1440 sizeof(struct mqueue_inode_info), 0, 1440 sizeof(struct mqueue_inode_info), 0,
1441 SLAB_HWCACHE_ALIGN, init_once); 1441 SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, init_once);
1442 if (mqueue_inode_cachep == NULL) 1442 if (mqueue_inode_cachep == NULL)
1443 return -ENOMEM; 1443 return -ENOMEM;
1444 1444
diff --git a/kernel/cred.c b/kernel/cred.c
index 71179a09c1d6..0c0cd8a62285 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -569,8 +569,8 @@ EXPORT_SYMBOL(revert_creds);
569void __init cred_init(void) 569void __init cred_init(void)
570{ 570{
571 /* allocate a slab in which we can store credentials */ 571 /* allocate a slab in which we can store credentials */
572 cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred), 572 cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred), 0,
573 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); 573 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL);
574} 574}
575 575
576/** 576/**
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index ef90b04d783f..435c14a45118 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -34,7 +34,7 @@ __setup("nodelayacct", delayacct_setup_disable);
34 34
35void delayacct_init(void) 35void delayacct_init(void)
36{ 36{
37 delayacct_cache = KMEM_CACHE(task_delay_info, SLAB_PANIC); 37 delayacct_cache = KMEM_CACHE(task_delay_info, SLAB_PANIC|SLAB_ACCOUNT);
38 delayacct_tsk_init(&init_task); 38 delayacct_tsk_init(&init_task);
39} 39}
40 40
diff --git a/kernel/fork.c b/kernel/fork.c
index 6774e6b2e96d..51915842f1c0 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -300,9 +300,9 @@ void __init fork_init(void)
300#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES 300#define ARCH_MIN_TASKALIGN L1_CACHE_BYTES
301#endif 301#endif
302 /* create a slab on which task_structs can be allocated */ 302 /* create a slab on which task_structs can be allocated */
303 task_struct_cachep = 303 task_struct_cachep = kmem_cache_create("task_struct",
304 kmem_cache_create("task_struct", arch_task_struct_size, 304 arch_task_struct_size, ARCH_MIN_TASKALIGN,
305 ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL); 305 SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT, NULL);
306#endif 306#endif
307 307
308 /* do the arch specific task caches init */ 308 /* do the arch specific task caches init */
@@ -1848,16 +1848,19 @@ void __init proc_caches_init(void)
1848 sighand_cachep = kmem_cache_create("sighand_cache", 1848 sighand_cachep = kmem_cache_create("sighand_cache",
1849 sizeof(struct sighand_struct), 0, 1849 sizeof(struct sighand_struct), 0,
1850 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_DESTROY_BY_RCU| 1850 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_DESTROY_BY_RCU|
1851 SLAB_NOTRACK, sighand_ctor); 1851 SLAB_NOTRACK|SLAB_ACCOUNT, sighand_ctor);
1852 signal_cachep = kmem_cache_create("signal_cache", 1852 signal_cachep = kmem_cache_create("signal_cache",
1853 sizeof(struct signal_struct), 0, 1853 sizeof(struct signal_struct), 0,
1854 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL); 1854 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
1855 NULL);
1855 files_cachep = kmem_cache_create("files_cache", 1856 files_cachep = kmem_cache_create("files_cache",
1856 sizeof(struct files_struct), 0, 1857 sizeof(struct files_struct), 0,
1857 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL); 1858 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
1859 NULL);
1858 fs_cachep = kmem_cache_create("fs_cache", 1860 fs_cachep = kmem_cache_create("fs_cache",
1859 sizeof(struct fs_struct), 0, 1861 sizeof(struct fs_struct), 0,
1860 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL); 1862 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
1863 NULL);
1861 /* 1864 /*
1862 * FIXME! The "sizeof(struct mm_struct)" currently includes the 1865 * FIXME! The "sizeof(struct mm_struct)" currently includes the
1863 * whole struct cpumask for the OFFSTACK case. We could change 1866 * whole struct cpumask for the OFFSTACK case. We could change
@@ -1867,8 +1870,9 @@ void __init proc_caches_init(void)
1867 */ 1870 */
1868 mm_cachep = kmem_cache_create("mm_struct", 1871 mm_cachep = kmem_cache_create("mm_struct",
1869 sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN, 1872 sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN,
1870 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL); 1873 SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
1871 vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC); 1874 NULL);
1875 vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC|SLAB_ACCOUNT);
1872 mmap_init(); 1876 mmap_init();
1873 nsproxy_cache_init(); 1877 nsproxy_cache_init();
1874} 1878}
diff --git a/kernel/pid.c b/kernel/pid.c
index 78b3d9f80d44..f4ad91b746f1 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -604,5 +604,5 @@ void __init pidmap_init(void)
604 atomic_dec(&init_pid_ns.pidmap[0].nr_free); 604 atomic_dec(&init_pid_ns.pidmap[0].nr_free);
605 605
606 init_pid_ns.pid_cachep = KMEM_CACHE(pid, 606 init_pid_ns.pid_cachep = KMEM_CACHE(pid,
607 SLAB_HWCACHE_ALIGN | SLAB_PANIC); 607 SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
608} 608}
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862c859b..fbf6f0f1d6c9 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -560,7 +560,7 @@ void __init mmap_init(void)
560 560
561 ret = percpu_counter_init(&vm_committed_as, 0, GFP_KERNEL); 561 ret = percpu_counter_init(&vm_committed_as, 0, GFP_KERNEL);
562 VM_BUG_ON(ret); 562 VM_BUG_ON(ret);
563 vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC); 563 vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC|SLAB_ACCOUNT);
564} 564}
565 565
566/* 566/*
diff --git a/mm/rmap.c b/mm/rmap.c
index b577fbb98d4b..3c3f1d21f075 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -428,8 +428,10 @@ static void anon_vma_ctor(void *data)
428void __init anon_vma_init(void) 428void __init anon_vma_init(void)
429{ 429{
430 anon_vma_cachep = kmem_cache_create("anon_vma", sizeof(struct anon_vma), 430 anon_vma_cachep = kmem_cache_create("anon_vma", sizeof(struct anon_vma),
431 0, SLAB_DESTROY_BY_RCU|SLAB_PANIC, anon_vma_ctor); 431 0, SLAB_DESTROY_BY_RCU|SLAB_PANIC|SLAB_ACCOUNT,
432 anon_vma_chain_cachep = KMEM_CACHE(anon_vma_chain, SLAB_PANIC); 432 anon_vma_ctor);
433 anon_vma_chain_cachep = KMEM_CACHE(anon_vma_chain,
434 SLAB_PANIC|SLAB_ACCOUNT);
433} 435}
434 436
435/* 437/*
diff --git a/mm/shmem.c b/mm/shmem.c
index 5813b7fa85b6..9e60093aca3f 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3064,7 +3064,7 @@ static int shmem_init_inodecache(void)
3064{ 3064{
3065 shmem_inode_cachep = kmem_cache_create("shmem_inode_cache", 3065 shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
3066 sizeof(struct shmem_inode_info), 3066 sizeof(struct shmem_inode_info),
3067 0, SLAB_PANIC, shmem_init_inode); 3067 0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode);
3068 return 0; 3068 return 0;
3069} 3069}
3070 3070
diff --git a/net/socket.c b/net/socket.c
index 91c2de6f5020..c044d1e8508c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -294,7 +294,7 @@ static int init_inodecache(void)
294 0, 294 0,
295 (SLAB_HWCACHE_ALIGN | 295 (SLAB_HWCACHE_ALIGN |
296 SLAB_RECLAIM_ACCOUNT | 296 SLAB_RECLAIM_ACCOUNT |
297 SLAB_MEM_SPREAD), 297 SLAB_MEM_SPREAD | SLAB_ACCOUNT),
298 init_once); 298 init_once);
299 if (sock_inode_cachep == NULL) 299 if (sock_inode_cachep == NULL)
300 return -ENOMEM; 300 return -ENOMEM;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index d81186d34558..14f45bf0410c 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1500,7 +1500,7 @@ int register_rpc_pipefs(void)
1500 rpc_inode_cachep = kmem_cache_create("rpc_inode_cache", 1500 rpc_inode_cachep = kmem_cache_create("rpc_inode_cache",
1501 sizeof(struct rpc_inode), 1501 sizeof(struct rpc_inode),
1502 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| 1502 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
1503 SLAB_MEM_SPREAD), 1503 SLAB_MEM_SPREAD|SLAB_ACCOUNT),
1504 init_once); 1504 init_once);
1505 if (!rpc_inode_cachep) 1505 if (!rpc_inode_cachep)
1506 return -ENOMEM; 1506 return -ENOMEM;