kmemcg: account certain kmem allocations to memcg
authorVladimir Davydov <vdavydov@virtuozzo.com>
Thu, 14 Jan 2016 23:18:21 +0000 (15:18 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Jan 2016 00:00:49 +0000 (16:00 -0800)
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>
65 files changed:
arch/powerpc/platforms/cell/spufs/inode.c
drivers/staging/lustre/lustre/llite/super25.c
fs/9p/v9fs.c
fs/adfs/super.c
fs/affs/super.c
fs/afs/super.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/block_dev.c
fs/btrfs/inode.c
fs/ceph/super.c
fs/cifs/cifsfs.c
fs/coda/inode.c
fs/dcache.c
fs/ecryptfs/main.c
fs/efs/super.c
fs/exofs/super.c
fs/ext2/super.c
fs/ext4/super.c
fs/f2fs/super.c
fs/fat/inode.c
fs/file.c
fs/fuse/inode.c
fs/gfs2/main.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hostfs/hostfs_kern.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/isofs/inode.c
fs/jffs2/super.c
fs/jfs/super.c
fs/logfs/inode.c
fs/minix/inode.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/nilfs2/super.c
fs/ntfs/super.c
fs/ocfs2/dlmfs/dlmfs.c
fs/ocfs2/super.c
fs/openpromfs/inode.c
fs/proc/inode.c
fs/qnx4/inode.c
fs/qnx6/inode.c
fs/reiserfs/super.c
fs/romfs/super.c
fs/squashfs/super.c
fs/sysv/inode.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/kmem.h
fs/xfs/xfs_super.c
include/linux/thread_info.h
ipc/mqueue.c
kernel/cred.c
kernel/delayacct.c
kernel/fork.c
kernel/pid.c
mm/nommu.c
mm/rmap.c
mm/shmem.c
net/socket.c
net/sunrpc/rpc_pipe.c

index 11634fa7ab3c1dfe5bab4081b5250a8bf83faf54..ad4840f86be1f53a127ac829b62d2cc41c95ce49 100644 (file)
@@ -767,7 +767,7 @@ static int __init spufs_init(void)
        ret = -ENOMEM;
        spufs_inode_cache = kmem_cache_create("spufs_inode_cache",
                        sizeof(struct spufs_inode_info), 0,
-                       SLAB_HWCACHE_ALIGN, spufs_init_once);
+                       SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, spufs_init_once);
 
        if (!spufs_inode_cache)
                goto out;
index 7a9fafc676935dc8de97f4da5ad9699cc4cfe4ca..86c371ef71eaef079bbf4885841925ead6f6649c 100644 (file)
@@ -106,7 +106,8 @@ static int __init init_lustre_lite(void)
        rc = -ENOMEM;
        ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
                                            sizeof(struct ll_inode_info),
-                                           0, SLAB_HWCACHE_ALIGN, NULL);
+                                           0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
+                                           NULL);
        if (ll_inode_cachep == NULL)
                goto out_cache;
 
index 6caca025019d1cd68baacf7699592b931ba4c2b7..072e7599583a81a273c2f6a6f585b42fedfafa45 100644 (file)
@@ -575,7 +575,7 @@ static int v9fs_init_inode_cache(void)
        v9fs_inode_cache = kmem_cache_create("v9fs_inode_cache",
                                          sizeof(struct v9fs_inode),
                                          0, (SLAB_RECLAIM_ACCOUNT|
-                                             SLAB_MEM_SPREAD),
+                                             SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                          v9fs_inode_init_once);
        if (!v9fs_inode_cache)
                return -ENOMEM;
index 4d4a0df8344fe2a7d9316d91e890a62a40a34172..c9fdfb11293357f1d79c0d729bc4d5db1118509d 100644 (file)
@@ -271,7 +271,7 @@ static int __init init_inodecache(void)
        adfs_inode_cachep = kmem_cache_create("adfs_inode_cache",
                                             sizeof(struct adfs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (adfs_inode_cachep == NULL)
                return -ENOMEM;
index 8836df5f1e11181e9fae8db39b5bd91eac1e59e0..2a6713b6b9f4635ea4dc633081443f48fca70752 100644 (file)
@@ -132,7 +132,7 @@ static int __init init_inodecache(void)
        affs_inode_cachep = kmem_cache_create("affs_inode_cache",
                                             sizeof(struct affs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (affs_inode_cachep == NULL)
                return -ENOMEM;
index 1fb4a5129f7dfc0007dfa52f287ca03766feeff0..81afefe7d8a6ec4602f95e7db4c2f8fc0dc12e48 100644 (file)
@@ -91,7 +91,7 @@ int __init afs_fs_init(void)
        afs_inode_cachep = kmem_cache_create("afs_inode_cache",
                                             sizeof(struct afs_vnode),
                                             0,
-                                            SLAB_HWCACHE_ALIGN,
+                                            SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
                                             afs_i_init_once);
        if (!afs_inode_cachep) {
                printk(KERN_NOTICE "kAFS: Failed to allocate inode cache\n");
index 25250fa87086316a95d8877935d810cd8d305196..cc0e08252913a46141c939d323485a55eb74760f 100644 (file)
@@ -434,7 +434,7 @@ befs_init_inodecache(void)
        befs_inode_cachep = kmem_cache_create("befs_inode_cache",
                                              sizeof (struct befs_inode_info),
                                              0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                              init_once);
        if (befs_inode_cachep == NULL) {
                pr_err("%s: Couldn't initialize inode slabcache\n", __func__);
index fdcb4d69f430db6370e1eed7c1c04c9a3f333746..1e5c896f6b79f85de6395d085bff9045e372eda5 100644 (file)
@@ -270,7 +270,7 @@ static int __init init_inodecache(void)
        bfs_inode_cachep = kmem_cache_create("bfs_inode_cache",
                                             sizeof(struct bfs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (bfs_inode_cachep == NULL)
                return -ENOMEM;
index d878e4860fb7cb60b8588e5cc43837cec5ec6f58..d33071dd683ec54fe35a1aefbc1b0c6481e7fd58 100644 (file)
@@ -595,7 +595,7 @@ void __init bdev_cache_init(void)
 
        bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
                        0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-                               SLAB_MEM_SPREAD|SLAB_PANIC),
+                               SLAB_MEM_SPREAD|SLAB_ACCOUNT|SLAB_PANIC),
                        init_once);
        err = register_filesystem(&bd_type);
        if (err)
index 3b8856e182ae7b7ee0d6ee4c32454cfc9bffdc3a..394017831692beb5a59ff7b2c747c0a824e188ce 100644 (file)
@@ -9161,7 +9161,8 @@ int btrfs_init_cachep(void)
 {
        btrfs_inode_cachep = kmem_cache_create("btrfs_inode",
                        sizeof(struct btrfs_inode), 0,
-                       SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD, init_once);
+                       SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT,
+                       init_once);
        if (!btrfs_inode_cachep)
                goto fail;
 
index f446afada328a45c2b70f648cbb48261e11e996c..ca4d5e8457f1e5340330bb225b4da84c88727dc5 100644 (file)
@@ -639,8 +639,8 @@ static int __init init_caches(void)
        ceph_inode_cachep = kmem_cache_create("ceph_inode_info",
                                      sizeof(struct ceph_inode_info),
                                      __alignof__(struct ceph_inode_info),
-                                     (SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD),
-                                     ceph_inode_init_once);
+                                     SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
+                                     SLAB_ACCOUNT, ceph_inode_init_once);
        if (ceph_inode_cachep == NULL)
                return -ENOMEM;
 
index b7fcb3151103cefcc02ecaaf042b59e2b2ff9454..c4c1169814b21d15463410ca474ef8a8608c0ed0 100644 (file)
@@ -1092,7 +1092,7 @@ cifs_init_inodecache(void)
        cifs_inode_cachep = kmem_cache_create("cifs_inode_cache",
                                              sizeof(struct cifsInodeInfo),
                                              0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                              cifs_init_once);
        if (cifs_inode_cachep == NULL)
                return -ENOMEM;
index cac1390b87a35a92b7089aaa574f683369088da7..57e81cbba0fa56134e53c4396afb6f27fb943fbe 100644 (file)
@@ -74,9 +74,9 @@ static void init_once(void *foo)
 int __init coda_init_inodecache(void)
 {
        coda_inode_cachep = kmem_cache_create("coda_inode_cache",
-                               sizeof(struct coda_inode_info),
-                               0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
-                               init_once);
+                               sizeof(struct coda_inode_info), 0,
+                               SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
+                               SLAB_ACCOUNT, init_once);
        if (coda_inode_cachep == NULL)
                return -ENOMEM;
        return 0;
index 8d38cd07b207b9234d0f571bb4a945e05a395c7b..b4539e84e5779a48c470804f9051ca5f3142eb48 100644 (file)
@@ -1571,7 +1571,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
        dentry->d_iname[DNAME_INLINE_LEN-1] = 0;
        if (name->len > DNAME_INLINE_LEN-1) {
                size_t size = offsetof(struct external_name, name[1]);
-               struct external_name *p = kmalloc(size + name->len, GFP_KERNEL);
+               struct external_name *p = kmalloc(size + name->len,
+                                                 GFP_KERNEL_ACCOUNT);
                if (!p) {
                        kmem_cache_free(dentry_cache, dentry); 
                        return NULL;
@@ -3415,7 +3416,7 @@ static void __init dcache_init(void)
         * of the dcache. 
         */
        dentry_cache = KMEM_CACHE(dentry,
-               SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
+               SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT);
 
        /* Hash may have been set up in dcache_init_early */
        if (!hashdist)
index 4f4d0474bee961e456d015a08f5891b686b9033c..e25b6b06bacf2cf8719d76d06e6efb8a60bd78b8 100644 (file)
@@ -663,6 +663,7 @@ static struct ecryptfs_cache_info {
        struct kmem_cache **cache;
        const char *name;
        size_t size;
+       unsigned long flags;
        void (*ctor)(void *obj);
 } ecryptfs_cache_infos[] = {
        {
@@ -684,6 +685,7 @@ static struct ecryptfs_cache_info {
                .cache = &ecryptfs_inode_info_cache,
                .name = "ecryptfs_inode_cache",
                .size = sizeof(struct ecryptfs_inode_info),
+               .flags = SLAB_ACCOUNT,
                .ctor = inode_info_init_once,
        },
        {
@@ -755,8 +757,8 @@ static int ecryptfs_init_kmem_caches(void)
                struct ecryptfs_cache_info *info;
 
                info = &ecryptfs_cache_infos[i];
-               *(info->cache) = kmem_cache_create(info->name, info->size,
-                               0, SLAB_HWCACHE_ALIGN, info->ctor);
+               *(info->cache) = kmem_cache_create(info->name, info->size, 0,
+                               SLAB_HWCACHE_ALIGN | info->flags, info->ctor);
                if (!*(info->cache)) {
                        ecryptfs_free_kmem_caches();
                        ecryptfs_printk(KERN_WARNING, "%s: "
index c8411a30f7dacd20a3723b7caf4f80da8b48fee4..cb68dac4f9d32d64d688079c3a25ea41bdfede33 100644 (file)
@@ -94,9 +94,9 @@ static void init_once(void *foo)
 static int __init init_inodecache(void)
 {
        efs_inode_cachep = kmem_cache_create("efs_inode_cache",
-                               sizeof(struct efs_inode_info),
-                               0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
-                               init_once);
+                               sizeof(struct efs_inode_info), 0,
+                               SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
+                               SLAB_ACCOUNT, init_once);
        if (efs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;
index b795c567b5e1df6e89a6531fabb1a493b9e541b4..6658a50530a068fefb3ec22de0b7d961bc6dc869 100644 (file)
@@ -194,8 +194,8 @@ static int init_inodecache(void)
 {
        exofs_inode_cachep = kmem_cache_create("exofs_inode_cache",
                                sizeof(struct exofs_i_info), 0,
-                               SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
-                               exofs_init_once);
+                               SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
+                               SLAB_ACCOUNT, exofs_init_once);
        if (exofs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;
index 748d35afc90266123407d61d7aed944f2e9ad9ca..2a188413a2b099a31107d7de99d8aa5f79afe806 100644 (file)
@@ -203,7 +203,7 @@ static int __init init_inodecache(void)
        ext2_inode_cachep = kmem_cache_create("ext2_inode_cache",
                                             sizeof(struct ext2_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (ext2_inode_cachep == NULL)
                return -ENOMEM;
index c9ab67da6e5abbe871ce4bc7760c007e07f2b479..f1b56ff0120894e3e4cc79886928ea7852ac5e25 100644 (file)
@@ -966,7 +966,7 @@ static int __init init_inodecache(void)
        ext4_inode_cachep = kmem_cache_create("ext4_inode_cache",
                                             sizeof(struct ext4_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (ext4_inode_cachep == NULL)
                return -ENOMEM;
index 3bf990b80026229590dcb7b3fd8647a31927d4d0..6134832baaaf0b25a86ed9cec1e8121b3ba3e4e2 100644 (file)
@@ -1541,8 +1541,9 @@ MODULE_ALIAS_FS("f2fs");
 
 static int __init init_inodecache(void)
 {
-       f2fs_inode_cachep = f2fs_kmem_cache_create("f2fs_inode_cache",
-                       sizeof(struct f2fs_inode_info));
+       f2fs_inode_cachep = kmem_cache_create("f2fs_inode_cache",
+                       sizeof(struct f2fs_inode_info), 0,
+                       SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT, NULL);
        if (!f2fs_inode_cachep)
                return -ENOMEM;
        return 0;
index 509411dd3698959c0b8c387dcf0f487b5da12abe..6aece96df19fcebdda5ed3f036205bbaeddc65a6 100644 (file)
@@ -677,7 +677,7 @@ static int __init fat_init_inodecache(void)
        fat_inode_cachep = kmem_cache_create("fat_inode_cache",
                                             sizeof(struct msdos_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (fat_inode_cachep == NULL)
                return -ENOMEM;
index 1aed0add16a2c05d88249472744e6048232aea88..1fbc5c0555a9caefb153f9b07cbc716583ef658e 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -37,11 +37,12 @@ static void *alloc_fdmem(size_t size)
         * vmalloc() if the allocation size will be considered "large" by the VM.
         */
        if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
-               void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY);
+               void *data = kmalloc(size, GFP_KERNEL_ACCOUNT |
+                                    __GFP_NOWARN | __GFP_NORETRY);
                if (data != NULL)
                        return data;
        }
-       return vmalloc(size);
+       return __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM, PAGE_KERNEL);
 }
 
 static void __free_fdtable(struct fdtable *fdt)
@@ -126,7 +127,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
        if (unlikely(nr > sysctl_nr_open))
                nr = ((sysctl_nr_open - 1) | (BITS_PER_LONG - 1)) + 1;
 
-       fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL);
+       fdt = kmalloc(sizeof(struct fdtable), GFP_KERNEL_ACCOUNT);
        if (!fdt)
                goto out;
        fdt->max_fds = nr;
index 2913db2a5b99bee2b01b79d07b1451f752f0ec01..4d69d5c0bedcdeedbf07ae4e4f63ae6ccfc85ad6 100644 (file)
@@ -1255,8 +1255,8 @@ static int __init fuse_fs_init(void)
        int err;
 
        fuse_inode_cachep = kmem_cache_create("fuse_inode",
-                                             sizeof(struct fuse_inode),
-                                             0, SLAB_HWCACHE_ALIGN,
+                                             sizeof(struct fuse_inode), 0,
+                                             SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
                                              fuse_inode_init_once);
        err = -ENOMEM;
        if (!fuse_inode_cachep)
index 1d709d496364b122b9742203fbabcefd012179dd..f99f8e94de3f3a65ff53839a282a160fa2ac41b2 100644 (file)
@@ -114,7 +114,8 @@ static int __init init_gfs2_fs(void)
        gfs2_inode_cachep = kmem_cache_create("gfs2_inode",
                                              sizeof(struct gfs2_inode),
                                              0,  SLAB_RECLAIM_ACCOUNT|
-                                                 SLAB_MEM_SPREAD,
+                                                 SLAB_MEM_SPREAD|
+                                                 SLAB_ACCOUNT,
                                              gfs2_init_inode_once);
        if (!gfs2_inode_cachep)
                goto fail;
index 4574fdd3d4219f86aa779f0012cee42252a7ea10..1ca95c232bb5c7d071250f46bed489a73b807abd 100644 (file)
@@ -483,8 +483,8 @@ static int __init init_hfs_fs(void)
        int err;
 
        hfs_inode_cachep = kmem_cache_create("hfs_inode_cache",
-               sizeof(struct hfs_inode_info), 0, SLAB_HWCACHE_ALIGN,
-               hfs_init_once);
+               sizeof(struct hfs_inode_info), 0,
+               SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, hfs_init_once);
        if (!hfs_inode_cachep)
                return -ENOMEM;
        err = register_filesystem(&hfs_fs_type);
index 7302d96ae8bfd742fe9f360f70ccd5d1b5df085d..5d54490a136d8accfab797bdd3ed3e8bd6ae0d75 100644 (file)
@@ -663,7 +663,7 @@ static int __init init_hfsplus_fs(void)
        int err;
 
        hfsplus_inode_cachep = kmem_cache_create("hfsplus_icache",
-               HFSPLUS_INODE_SIZE, 0, SLAB_HWCACHE_ALIGN,
+               HFSPLUS_INODE_SIZE, 0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT,
                hfsplus_init_once);
        if (!hfsplus_inode_cachep)
                return -ENOMEM;
index f49be23e78aab4a25599fe97839848211432c05a..cfaa18c7a33796e0ee330d7b67e4b98bb6a95072 100644 (file)
@@ -223,7 +223,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
 {
        struct hostfs_inode_info *hi;
 
-       hi = kmalloc(sizeof(*hi), GFP_KERNEL);
+       hi = kmalloc(sizeof(*hi), GFP_KERNEL_ACCOUNT);
        if (hi == NULL)
                return NULL;
        hi->fd = -1;
index a561591896bd34fe79c94daa52f5803f6a682238..458cf463047b683e7d76460fa950deede1e8aaad 100644 (file)
@@ -261,7 +261,7 @@ static int init_inodecache(void)
        hpfs_inode_cachep = kmem_cache_create("hpfs_inode_cache",
                                             sizeof(struct hpfs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (hpfs_inode_cachep == NULL)
                return -ENOMEM;
index d8f51ee8126b3282156721d2d2639e24d3aa536e..f6820ecf0a11f6c7af0507c1db73ce1b7387770f 100644 (file)
@@ -1322,7 +1322,7 @@ static int __init init_hugetlbfs_fs(void)
        error = -ENOMEM;
        hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
                                        sizeof(struct hugetlbfs_inode_info),
-                                       0, 0, init_once);
+                                       0, SLAB_ACCOUNT, init_once);
        if (hugetlbfs_inode_cachep == NULL)
                goto out2;
 
index 4230f66b741017adaf080ead885896212485d906..e491e54d243025999e42fdec674b082a765188fd 100644 (file)
@@ -1883,7 +1883,7 @@ void __init inode_init(void)
                                         sizeof(struct inode),
                                         0,
                                         (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
-                                        SLAB_MEM_SPREAD),
+                                        SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                         init_once);
 
        /* Hash may have been set up in inode_init_early */
index 61abdc4920dab0056e998682f01038ef0a17f178..bcd2d41b318a49688f05068bd278145b16544465 100644 (file)
@@ -94,7 +94,7 @@ static int __init init_inodecache(void)
        isofs_inode_cachep = kmem_cache_create("isofs_inode_cache",
                                        sizeof(struct iso_inode_info),
                                        0, (SLAB_RECLAIM_ACCOUNT|
-                                       SLAB_MEM_SPREAD),
+                                       SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                        init_once);
        if (isofs_inode_cachep == NULL)
                return -ENOMEM;
index d86c5e3176a133cd898a62ff8a587010da845385..bb080c272149312ea382ee578ffdaa903620a43a 100644 (file)
@@ -387,7 +387,7 @@ static int __init init_jffs2_fs(void)
        jffs2_inode_cachep = kmem_cache_create("jffs2_i",
                                             sizeof(struct jffs2_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             jffs2_i_init_once);
        if (!jffs2_inode_cachep) {
                pr_err("error: Failed to initialise inode cache\n");
index 8f9176caf098c559bbe3c9975b2dff9fffb0ffb4..900925b5eb8c225b151b58cf8133ee6a6e11e1b1 100644 (file)
@@ -898,7 +898,7 @@ static int __init init_jfs_fs(void)
 
        jfs_inode_cachep =
            kmem_cache_create("jfs_ip", sizeof(struct jfs_inode_info), 0,
-                           SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
+                           SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT,
                            init_once);
        if (jfs_inode_cachep == NULL)
                return -ENOMEM;
index 0fce46d62b9c20491a9fb248f55a39b2273def74..db9cfc5988836f125ef0adf1fce387bc726f53dd 100644 (file)
@@ -409,7 +409,8 @@ const struct super_operations logfs_super_operations = {
 int logfs_init_inode_cache(void)
 {
        logfs_inode_cache = kmem_cache_create("logfs_inode_cache",
-                       sizeof(struct logfs_inode), 0, SLAB_RECLAIM_ACCOUNT,
+                       sizeof(struct logfs_inode), 0,
+                       SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
                        logfs_init_once);
        if (!logfs_inode_cache)
                return -ENOMEM;
index cb1789ca1ee675d1d101fb272ec05c28557b0186..f975d667c53900c08526e4774b8f74a96e822dbb 100644 (file)
@@ -91,7 +91,7 @@ static int __init init_inodecache(void)
        minix_inode_cachep = kmem_cache_create("minix_inode_cache",
                                             sizeof(struct minix_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (minix_inode_cachep == NULL)
                return -ENOMEM;
index ce1eb3f9dfe8005e34567bab5cbb04d3f8ce10a5..1af15fcbe57b74c74c85dff9b956be07bea49f79 100644 (file)
@@ -82,7 +82,7 @@ static int init_inodecache(void)
        ncp_inode_cachep = kmem_cache_create("ncp_inode_cache",
                                             sizeof(struct ncp_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (ncp_inode_cachep == NULL)
                return -ENOMEM;
index bdb4dc7b4ecde1531d6801b6cacbab3a004d1fb4..48fd8a87affe569c942f5b3a054e3c414e4adac8 100644 (file)
@@ -1933,7 +1933,7 @@ static int __init nfs_init_inodecache(void)
        nfs_inode_cachep = kmem_cache_create("nfs_inode_cache",
                                             sizeof(struct nfs_inode),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (nfs_inode_cachep == NULL)
                return -ENOMEM;
index c7343844e6b62a7ca3c78f9f4fa12e59f97dfdbf..7f5d3d9f1c37bcdabda95cdad2e58cd753f88cc8 100644 (file)
@@ -1416,7 +1416,8 @@ static int __init nilfs_init_cachep(void)
 {
        nilfs_inode_cachep = kmem_cache_create("nilfs2_inode_cache",
                        sizeof(struct nilfs_inode_info), 0,
-                       SLAB_RECLAIM_ACCOUNT, nilfs_inode_init_once);
+                       SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
+                       nilfs_inode_init_once);
        if (!nilfs_inode_cachep)
                goto fail;
 
index d1a853585b539012a26cd55aca22307fa759ce87..2f77f8dfb861415c9e5196c129d6d4902e042ce8 100644 (file)
@@ -3139,8 +3139,8 @@ static int __init init_ntfs_fs(void)
 
        ntfs_big_inode_cache = kmem_cache_create(ntfs_big_inode_cache_name,
                        sizeof(big_ntfs_inode), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
-                       ntfs_big_inode_init_once);
+                       SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|
+                       SLAB_ACCOUNT, ntfs_big_inode_init_once);
        if (!ntfs_big_inode_cache) {
                pr_crit("Failed to create %s!\n", ntfs_big_inode_cache_name);
                goto big_inode_err_out;
index b5cf27dcb18a78c71c3ef62410c3e4e7e7e641f9..03768bb3aab154fd408679f0c3fef500efec794d 100644 (file)
@@ -638,7 +638,7 @@ static int __init init_dlmfs_fs(void)
        dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache",
                                sizeof(struct dlmfs_inode_private),
                                0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-                                       SLAB_MEM_SPREAD),
+                                       SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                dlmfs_init_once);
        if (!dlmfs_inode_cache) {
                status = -ENOMEM;
index c62d761d6bf013d91d4c531dbb47d317cbe6b85a..faa1365097bcf38c28dfad30ca849c48e5015938 100644 (file)
@@ -1766,7 +1766,7 @@ static int ocfs2_initialize_mem_caches(void)
                                       sizeof(struct ocfs2_inode_info),
                                       0,
                                       (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                       ocfs2_inode_init_once);
        ocfs2_dquot_cachep = kmem_cache_create("ocfs2_dquot_cache",
                                        sizeof(struct ocfs2_dquot),
index 15e4500cda3ee28f56957d03adf120ae8d9f73fb..b61b883c8ff8e2f2634ddfe6eb0465c2e367c4ff 100644 (file)
@@ -443,7 +443,7 @@ static int __init init_openprom_fs(void)
                                            sizeof(struct op_inode_info),
                                            0,
                                            (SLAB_RECLAIM_ACCOUNT |
-                                            SLAB_MEM_SPREAD),
+                                            SLAB_MEM_SPREAD | SLAB_ACCOUNT),
                                            op_inode_init_once);
        if (!op_inode_cachep)
                return -ENOMEM;
index d0e9b9b6223e984879620839effb830fb7937219..42305ddcbaa00124cfbdaccf6c44b6c33cf7f701 100644 (file)
@@ -95,7 +95,8 @@ void __init proc_init_inodecache(void)
        proc_inode_cachep = kmem_cache_create("proc_inode_cache",
                                             sizeof(struct proc_inode),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD|SLAB_PANIC),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT|
+                                               SLAB_PANIC),
                                             init_once);
 }
 
index f37b3deb01b4d5f2d07ea90774a5bf99c39992bd..3a67cfb142d886c11558409c6711260ecf9dab70 100644 (file)
@@ -365,7 +365,7 @@ static int init_inodecache(void)
        qnx4_inode_cachep = kmem_cache_create("qnx4_inode_cache",
                                             sizeof(struct qnx4_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (qnx4_inode_cachep == NULL)
                return -ENOMEM;
index 9728b5499e1d5a1eae80344ff0e9e76dd1a04153..47bb1de07155e27a3ca553c16efa3a138c64b16a 100644 (file)
@@ -625,7 +625,7 @@ static int init_inodecache(void)
        qnx6_inode_cachep = kmem_cache_create("qnx6_inode_cache",
                                             sizeof(struct qnx6_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (!qnx6_inode_cachep)
                return -ENOMEM;
index 4a62fe8cc3bff619516fbe15d62a8cfaa1aaa581..05db7473bcb5c64078dc572d2ef8e455a770dbba 100644 (file)
@@ -626,7 +626,8 @@ static int __init init_inodecache(void)
                                                  sizeof(struct
                                                         reiserfs_inode_info),
                                                  0, (SLAB_RECLAIM_ACCOUNT|
-                                                       SLAB_MEM_SPREAD),
+                                                     SLAB_MEM_SPREAD|
+                                                     SLAB_ACCOUNT),
                                                  init_once);
        if (reiserfs_inode_cachep == NULL)
                return -ENOMEM;
index bb894e78a821ef4643e25cbf684832b5baaf054c..6b00ca357c58f891fc5638ad838e3b26d9ecb989 100644 (file)
@@ -619,8 +619,8 @@ static int __init init_romfs_fs(void)
        romfs_inode_cachep =
                kmem_cache_create("romfs_i",
                                  sizeof(struct romfs_inode_info), 0,
-                                 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
-                                 romfs_i_init_once);
+                                 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
+                                 SLAB_ACCOUNT, romfs_i_init_once);
 
        if (!romfs_inode_cachep) {
                pr_err("Failed to initialise inode cache\n");
index dded920cbc8f14da85efdefaeca147079aae59ac..5e79bfa4f260784dcba925e4d6611585542d88c6 100644 (file)
@@ -419,7 +419,8 @@ static int __init init_inodecache(void)
 {
        squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache",
                sizeof(struct squashfs_inode_info), 0,
-               SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, init_once);
+               SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|SLAB_ACCOUNT,
+               init_once);
 
        return squashfs_inode_cachep ? 0 : -ENOMEM;
 }
index 07ac18c355e777e0fe869225a70b5d6d9dba1f24..d62c423a5a2d8723807d2bb5f65b227042dcf724 100644 (file)
@@ -346,7 +346,7 @@ int __init sysv_init_icache(void)
 {
        sysv_inode_cachep = kmem_cache_create("sysv_inode_cache",
                        sizeof(struct sysv_inode_info), 0,
-                       SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
+                       SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD|SLAB_ACCOUNT,
                        init_once);
        if (!sysv_inode_cachep)
                return -ENOMEM;
index 1fd90c0795374b6abae3d9787e1b898bd1819546..a233ba913be4f0ebe91a56dc5dae9c6c8d01862c 100644 (file)
@@ -2248,8 +2248,8 @@ static int __init ubifs_init(void)
 
        ubifs_inode_slab = kmem_cache_create("ubifs_inode_slab",
                                sizeof(struct ubifs_inode), 0,
-                               SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT,
-                               &inode_slab_ctor);
+                               SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT |
+                               SLAB_ACCOUNT, &inode_slab_ctor);
        if (!ubifs_inode_slab)
                return -ENOMEM;
 
index 81155b9b445b3313cec45c89533bd1ea8027736e..9c64a3ca9837d99b9dd919b4e27c850a4363da1a 100644 (file)
@@ -179,7 +179,8 @@ static int __init init_inodecache(void)
        udf_inode_cachep = kmem_cache_create("udf_inode_cache",
                                             sizeof(struct udf_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT |
-                                                SLAB_MEM_SPREAD),
+                                                SLAB_MEM_SPREAD |
+                                                SLAB_ACCOUNT),
                                             init_once);
        if (!udf_inode_cachep)
                return -ENOMEM;
index f6390eec02cabbe1c8f5751433aa556d9e556829..442fd52ebffe5aed31ee80a1da341d74a77e2fbd 100644 (file)
@@ -1427,7 +1427,7 @@ static int __init init_inodecache(void)
        ufs_inode_cachep = kmem_cache_create("ufs_inode_cache",
                                             sizeof(struct ufs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                             init_once);
        if (ufs_inode_cachep == NULL)
                return -ENOMEM;
index cc6b768fc068f4aa22e994724e9d91fe8698c8e2..d1c66e465ca5629fe3e330b9f6b87b07a5f9a1fa 100644 (file)
@@ -84,6 +84,7 @@ kmem_zalloc(size_t size, xfs_km_flags_t flags)
 #define KM_ZONE_HWALIGN        SLAB_HWCACHE_ALIGN
 #define KM_ZONE_RECLAIM        SLAB_RECLAIM_ACCOUNT
 #define KM_ZONE_SPREAD SLAB_MEM_SPREAD
+#define KM_ZONE_ACCOUNT        SLAB_ACCOUNT
 
 #define kmem_zone      kmem_cache
 #define kmem_zone_t    struct kmem_cache
index b35775752b7451c8f7679eb1b17256584283003f..59c9b7bd958d6a034d792d3c777042173b3b817e 100644 (file)
@@ -1714,8 +1714,8 @@ xfs_init_zones(void)
 
        xfs_inode_zone =
                kmem_zone_init_flags(sizeof(xfs_inode_t), "xfs_inode",
-                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD,
-                       xfs_fs_inode_init_once);
+                       KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD |
+                       KM_ZONE_ACCOUNT, xfs_fs_inode_init_once);
        if (!xfs_inode_zone)
                goto out_destroy_efi_zone;
 
index ff307b548ed3c91a0f1cd05e486789305cefb43f..b4c2a485b28a737bce23f01663dc107d00179326 100644 (file)
@@ -56,9 +56,10 @@ extern long do_no_restart_syscall(struct restart_block *parm);
 #ifdef __KERNEL__
 
 #ifdef CONFIG_DEBUG_STACK_USAGE
-# define THREADINFO_GFP                (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
+# define THREADINFO_GFP                (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | \
+                                __GFP_ZERO)
 #else
-# define THREADINFO_GFP                (GFP_KERNEL | __GFP_NOTRACK)
+# define THREADINFO_GFP                (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK)
 #endif
 
 /*
index 161a1807e6efb0fe8e773c41dafc8b4a76b38f71..f4617cf07069213262f5c1c8bfb097ca7989b8ad 100644 (file)
@@ -1438,7 +1438,7 @@ static int __init init_mqueue_fs(void)
 
        mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache",
                                sizeof(struct mqueue_inode_info), 0,
-                               SLAB_HWCACHE_ALIGN, init_once);
+                               SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, init_once);
        if (mqueue_inode_cachep == NULL)
                return -ENOMEM;
 
index 71179a09c1d6a3240fd9c1a4ead58d89646da24e..0c0cd8a62285279a521b3f724189fe997da84ddb 100644 (file)
@@ -569,8 +569,8 @@ EXPORT_SYMBOL(revert_creds);
 void __init cred_init(void)
 {
        /* allocate a slab in which we can store credentials */
-       cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred),
-                                    0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
+       cred_jar = kmem_cache_create("cred_jar", sizeof(struct cred), 0,
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL);
 }
 
 /**
index ef90b04d783f143be42cfbf6153545e64e39a6e4..435c14a451181c7a69fb49d513d5d659cd75e814 100644 (file)
@@ -34,7 +34,7 @@ __setup("nodelayacct", delayacct_setup_disable);
 
 void delayacct_init(void)
 {
-       delayacct_cache = KMEM_CACHE(task_delay_info, SLAB_PANIC);
+       delayacct_cache = KMEM_CACHE(task_delay_info, SLAB_PANIC|SLAB_ACCOUNT);
        delayacct_tsk_init(&init_task);
 }
 
index 6774e6b2e96d6faa95f805e7521f98ba61e2e253..51915842f1c0644b8abbf29b6261f4e64357a104 100644 (file)
@@ -300,9 +300,9 @@ void __init fork_init(void)
 #define ARCH_MIN_TASKALIGN     L1_CACHE_BYTES
 #endif
        /* create a slab on which task_structs can be allocated */
-       task_struct_cachep =
-               kmem_cache_create("task_struct", arch_task_struct_size,
-                       ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
+       task_struct_cachep = kmem_cache_create("task_struct",
+                       arch_task_struct_size, ARCH_MIN_TASKALIGN,
+                       SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT, NULL);
 #endif
 
        /* do the arch specific task caches init */
@@ -1848,16 +1848,19 @@ void __init proc_caches_init(void)
        sighand_cachep = kmem_cache_create("sighand_cache",
                        sizeof(struct sighand_struct), 0,
                        SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_DESTROY_BY_RCU|
-                       SLAB_NOTRACK, sighand_ctor);
+                       SLAB_NOTRACK|SLAB_ACCOUNT, sighand_ctor);
        signal_cachep = kmem_cache_create("signal_cache",
                        sizeof(struct signal_struct), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
+                       NULL);
        files_cachep = kmem_cache_create("files_cache",
                        sizeof(struct files_struct), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
+                       NULL);
        fs_cachep = kmem_cache_create("fs_cache",
                        sizeof(struct fs_struct), 0,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
+                       NULL);
        /*
         * FIXME! The "sizeof(struct mm_struct)" currently includes the
         * whole struct cpumask for the OFFSTACK case. We could change
@@ -1867,8 +1870,9 @@ void __init proc_caches_init(void)
         */
        mm_cachep = kmem_cache_create("mm_struct",
                        sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN,
-                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK, NULL);
-       vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC);
+                       SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_NOTRACK|SLAB_ACCOUNT,
+                       NULL);
+       vm_area_cachep = KMEM_CACHE(vm_area_struct, SLAB_PANIC|SLAB_ACCOUNT);
        mmap_init();
        nsproxy_cache_init();
 }
index 78b3d9f80d443fb4fa601e41088eb2041385ab20..f4ad91b746f1e4afd96b3615a4bad844a0875528 100644 (file)
@@ -604,5 +604,5 @@ void __init pidmap_init(void)
        atomic_dec(&init_pid_ns.pidmap[0].nr_free);
 
        init_pid_ns.pid_cachep = KMEM_CACHE(pid,
-                       SLAB_HWCACHE_ALIGN | SLAB_PANIC);
+                       SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
 }
index 92be862c859bdce2b149e86760522ccb6d230524..fbf6f0f1d6c99ee2755b287847b9685ddfc26b51 100644 (file)
@@ -560,7 +560,7 @@ void __init mmap_init(void)
 
        ret = percpu_counter_init(&vm_committed_as, 0, GFP_KERNEL);
        VM_BUG_ON(ret);
-       vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC);
+       vm_region_jar = KMEM_CACHE(vm_region, SLAB_PANIC|SLAB_ACCOUNT);
 }
 
 /*
index b577fbb98d4baf352fa5e51cc536d02356b8392e..3c3f1d21f07585e1fd49b2e5003f65051c89a921 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -428,8 +428,10 @@ static void anon_vma_ctor(void *data)
 void __init anon_vma_init(void)
 {
        anon_vma_cachep = kmem_cache_create("anon_vma", sizeof(struct anon_vma),
-                       0, SLAB_DESTROY_BY_RCU|SLAB_PANIC, anon_vma_ctor);
-       anon_vma_chain_cachep = KMEM_CACHE(anon_vma_chain, SLAB_PANIC);
+                       0, SLAB_DESTROY_BY_RCU|SLAB_PANIC|SLAB_ACCOUNT,
+                       anon_vma_ctor);
+       anon_vma_chain_cachep = KMEM_CACHE(anon_vma_chain,
+                       SLAB_PANIC|SLAB_ACCOUNT);
 }
 
 /*
index 5813b7fa85b64667c7ea7f9c73da84e073b6d325..9e60093aca3fdd96bb32dc05daf1abc4ce2b6c54 100644 (file)
@@ -3064,7 +3064,7 @@ static int shmem_init_inodecache(void)
 {
        shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
                                sizeof(struct shmem_inode_info),
-                               0, SLAB_PANIC, shmem_init_inode);
+                               0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode);
        return 0;
 }
 
index 91c2de6f50205ae955afa1a41ad9502d35853c05..c044d1e8508cc2ba147c001897e4c9c26cc1a7e5 100644 (file)
@@ -294,7 +294,7 @@ static int init_inodecache(void)
                                              0,
                                              (SLAB_HWCACHE_ALIGN |
                                               SLAB_RECLAIM_ACCOUNT |
-                                              SLAB_MEM_SPREAD),
+                                              SLAB_MEM_SPREAD | SLAB_ACCOUNT),
                                              init_once);
        if (sock_inode_cachep == NULL)
                return -ENOMEM;
index d81186d34558c8c206c65bc5d05f36977734aafd..14f45bf0410c688b25fafedfb6636cfa025ad06c 100644 (file)
@@ -1500,7 +1500,7 @@ int register_rpc_pipefs(void)
        rpc_inode_cachep = kmem_cache_create("rpc_inode_cache",
                                sizeof(struct rpc_inode),
                                0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
-                                               SLAB_MEM_SPREAD),
+                                               SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                init_once);
        if (!rpc_inode_cachep)
                return -ENOMEM;