• Vladimir Davydov's avatar
    kmemcg: account certain kmem allocations to memcg · 5d097056
    Vladimir Davydov authored
    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: 's avatarVladimir Davydov <vdavydov@virtuozzo.com>
    Acked-by: 's avatarJohannes Weiner <hannes@cmpxchg.org>
    Acked-by: 's avatarMichal 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: 's avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
    5d097056
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
block.c Loading commit data...
cache.c Loading commit data...
decompressor.c Loading commit data...
decompressor.h Loading commit data...
decompressor_multi.c Loading commit data...
decompressor_multi_percpu.c Loading commit data...
decompressor_single.c Loading commit data...
dir.c Loading commit data...
export.c Loading commit data...
file.c Loading commit data...
file_cache.c Loading commit data...
file_direct.c Loading commit data...
fragment.c Loading commit data...
id.c Loading commit data...
inode.c Loading commit data...
lz4_wrapper.c Loading commit data...
lzo_wrapper.c Loading commit data...
namei.c Loading commit data...
page_actor.c Loading commit data...
page_actor.h Loading commit data...
squashfs.h Loading commit data...
squashfs_fs.h Loading commit data...
squashfs_fs_i.h Loading commit data...
squashfs_fs_sb.h Loading commit data...
super.c Loading commit data...
symlink.c Loading commit data...
xattr.c Loading commit data...
xattr.h Loading commit data...
xattr_id.c Loading commit data...
xz_wrapper.c Loading commit data...
zlib_wrapper.c Loading commit data...