]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: do not replicate get_mem_cgroup_from_mm in __mem_cgroup_try_charge
authorMichal Hocko <mhocko@suse.cz>
Mon, 7 Apr 2014 22:37:44 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:35:56 +0000 (16:35 -0700)
commit4be36bbabc5abe13630dfef20b8864f8eb9ad551
treec04f019844dacfafdd61ad2f97bb1a0a845066ee
parent7170292c580a3f3e4797f29afd147e13ef3c9991
memcg: do not replicate get_mem_cgroup_from_mm in __mem_cgroup_try_charge

__mem_cgroup_try_charge duplicates get_mem_cgroup_from_mm for charges
which came without a memcg.  The only reason seems to be a tiny
optimization when css_tryget is not called if the charge can be consumed
from the stock.  Nevertheless css_tryget is very cheap since it has been
reworked to use per-cpu counting so this optimization doesn't give us
anything these days.

So let's drop the code duplication so that the code is more readable.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c