OpenCloudOS-Kernel/fs/ceph
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 ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
acl.c posix acls: Remove duplicate xattr name definitions 2015-12-06 21:25:17 -05:00
addr.c mm, fs: introduce mapping_gfp_constraint() 2015-11-06 17:50:42 -08:00
cache.c ceph: fix a comment typo 2015-11-02 23:36:47 +01:00
cache.h ceph: fscache: add an interface to synchronize object store limit 2014-04-03 10:33:53 +08:00
caps.c ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
dir.c ceph: rework dcache readdir 2015-06-25 11:49:32 +03:00
export.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
file.c ceph: combine as many iovec as possile into one OSD request 2015-11-02 23:36:47 +01:00
inode.c replace ->follow_link() with new method that could stay in RCU mode 2015-12-08 22:41:54 -05:00
ioctl.c ceph: fix divide-by-zero in __validate_layout() 2014-10-14 12:57:05 -07:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
locks.c Move locks API users to locks_lock_inode_wait() 2015-10-22 14:57:36 -04:00
mds_client.c libceph: msg signing callouts don't need con argument 2015-11-02 23:37:45 +01:00
mds_client.h ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
mdsmap.c fs/ceph: replace pr_warning by pr_warn 2014-06-06 16:08:06 -07:00
snap.c ceph: fix queuing inode to mdsdir's snaprealm 2015-09-08 23:14:29 +03:00
strings.c ceph: rename snapshot support 2015-04-22 18:33:41 +03:00
super.c kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00
super.h ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
xattr.c ceph: pre-allocate data structure that tracks caps flushing 2015-06-25 11:49:31 +03:00