diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-12-12 16:54:56 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 12:42:46 -0800 |
commit | 95fc3c5010da8fd8bd3e2c8bc0fb9dc7606e3a3b (patch) | |
tree | ad75115170aa3093bd6c58c455c52da71b3d1310 /lib/syscall.c | |
parent | 9d100c5e470eaeee5809da289f22b0de165de6b2 (diff) | |
download | op-kernel-dev-95fc3c5010da8fd8bd3e2c8bc0fb9dc7606e3a3b.zip op-kernel-dev-95fc3c5010da8fd8bd3e2c8bc0fb9dc7606e3a3b.tar.gz |
memcg: do not abuse memcg_kmem_skip_account
task_struct->memcg_kmem_skip_account was initially introduced to avoid
recursion during kmem cache creation: memcg_kmem_get_cache, which is
called by kmem_cache_alloc to determine the per-memcg cache to account
allocation to, may issue lazy cache creation if the needed cache doesn't
exist, which means issuing yet another kmem_cache_alloc. We can't just
pass a flag to the nested kmem_cache_alloc disabling kmem accounting,
because there are hidden allocations, e.g. in INIT_WORK. So we
introduced a flag on the task_struct, memcg_kmem_skip_account, making
memcg_kmem_get_cache return immediately.
By its nature, the flag may also be used to disable accounting for
allocations shared among different cgroups, and currently it is used this
way in memcg_activate_kmem. Using it like this looks like abusing it to
me. If we want to disable accounting for some allocations (which we will
definitely want one day), we should either add GFP_NO_MEMCG or GFP_MEMCG
flag in order to blacklist/whitelist some allocations.
For now, let's simply remove memcg_stop/resume_kmem_account from
memcg_activate_kmem.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/syscall.c')
0 files changed, 0 insertions, 0 deletions