1
0
Fork 0
alistair23-linux/fs/9p
Vladimir Davydov 5d097056c9 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>
2016-01-14 16:00:49 -08:00
..
Kconfig fs/9p: xattr: add trusted and security namespaces 2013-07-07 22:02:18 -05:00
Makefile 9p: xattr simplifications 2015-11-13 20:34:33 -05:00
acl.c vfs: Distinguish between full xattr names and proper prefixes 2015-12-06 21:33:52 -05:00
acl.h 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 2013-02-26 02:46:07 -05:00
cache.c fs/9p: use fscache mutex rather than spinlock 2016-01-09 02:57:21 -05:00
cache.h fs: 9p: cache.h: Add #define of include guard 2015-11-11 02:19:50 -05:00
fid.c 9p: switch to %p[dD] 2014-10-09 02:39:04 -04:00
fid.h 9p: v9fs_fid_add() can't fail now 2013-02-28 01:18:14 -05:00
v9fs.c kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00
v9fs.h fs/9p: use fscache mutex rather than spinlock 2016-01-09 02:57:21 -05:00
v9fs_vfs.h 9p: switch p9_client_read() to passing struct iov_iter * 2015-04-11 22:28:27 -04:00
vfs_addr.c 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
vfs_dentry.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
vfs_dir.c fs/9p: fix readdir() 2015-04-24 15:45:03 -04:00
vfs_file.c Merge branch 'akpm' (patches from Andrew) 2015-11-05 23:10:54 -08:00
vfs_inode.c Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-01-12 17:11:47 -08:00
vfs_inode_dotl.c switch ->get_link() to delayed_call, kill ->put_link() 2015-12-30 13:01:03 -05:00
vfs_super.c v9fs: fix error handling in v9fs_session_init() 2015-06-08 09:05:06 -06:00
xattr.c vfs: Distinguish between full xattr names and proper prefixes 2015-12-06 21:33:52 -05:00
xattr.h 9p: xattr simplifications 2015-11-13 20:34:33 -05:00