linux-sg2042/fs/ufs
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/ufs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:06 -08:00
Makefile ufs: get rid of ->setattr() for symlinks 2015-12-06 20:43:26 -05:00
balloc.c fix ufs write vs readpage race when writing into a hole 2015-09-09 10:43:12 -07:00
cylinder.c
dir.c ufs: use dir_pages instead of ufs_dir_pages() 2015-06-23 18:02:01 -04:00
file.c make new_sync_{read,write}() static 2015-04-11 22:29:40 -04:00
ialloc.c fs/ufs: restore s_lock mutex 2015-06-16 02:07:38 -04:00
inode.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05: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
swab.h ufs: replace __inline with inline 2008-04-28 08:58:45 -07:00
ufs.h ufs: get rid of ->setattr() for symlinks 2015-12-06 20:43:26 -05:00
ufs_fs.h fs/ufs: get rid of write_super 2012-07-22 23:58:16 +04:00
util.c fs: ufs: remove cast for kmalloc return value 2013-03-18 14:15:58 +01:00
util.h ufs: use little-endian bitops 2011-03-23 19:46:19 -07:00