alistair23-linux/fs/logfs
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
..
compr.c zlib: slim down zlib_deflate() workspace when possible 2011-03-22 17:44:17 -07:00
dev_bdev.c logfs: fix build warning 2015-11-05 19:34:48 -08:00
dev_mtd.c mtd: fix merge conflict resolution breakage 2012-02-01 11:10:24 -08:00
dir.c don't put symlink bodies in pagecache into highmem 2015-12-08 22:41:36 -05:00
file.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
gc.c logfs: Prevent memory corruption 2012-01-28 11:24:21 +05:30
inode.c kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00
journal.c logfs: create a pagecache page if it is not present 2012-07-23 09:18:14 +05:30
Kconfig logfs: fix logfs build errors and dependencies 2016-01-14 16:00:49 -08:00
logfs.h Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-01-12 17:11:47 -08:00
logfs_abi.h fix "seperate" typos in comments 2010-05-10 11:56:30 +02:00
Makefile [LogFS] add new flash file system 2009-11-20 20:13:39 +01:00
readwrite.c logfs: constify logfs_block_ops structures 2016-01-09 02:55:45 -05:00
segment.c logfs: constify logfs_block_ops structures 2016-01-09 02:55:45 -05:00
super.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00