linux/fs/hpfs
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
..
alloc.c hpfs: add fstrim support 2015-07-09 13:35:30 -07:00
anode.c hpfs: convert to use leXX_add_cpu() 2012-10-06 03:05:08 +09:00
buffer.c hpfs: support hotfixes 2015-09-03 11:55:30 -07:00
dentry.c Don't pass inode to ->d_hash() and ->d_compare() 2013-06-29 12:57:36 +04:00
dir.c hpfs: add fstrim support 2015-07-09 13:35:30 -07:00
dnode.c fs/hpfs/dnode.c: fix suspect code indent 2014-08-08 15:57:22 -07:00
ea.c fs/hpfs: increase pr_warn level 2014-06-06 16:08:10 -07:00
file.c hpfs: support hotfixes 2015-09-03 11:55:30 -07:00
hpfs_fn.h hpfs: support hotfixes 2015-09-03 11:55:30 -07:00
hpfs.h hpfs: assorted endianness annotations 2012-05-29 23:28:39 -04:00
inode.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05:00
Kconfig HPFS: Make HPFS compile on preempt and SMP 2011-05-09 09:04:23 -07:00
Makefile
map.c hpfs: missing endianness annotation 2016-01-04 10:29:03 -05:00
name.c fs/hpfs: increase pr_warn level 2014-06-06 16:08:10 -07:00
namei.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05:00
super.c kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00