]> git.karo-electronics.de Git - karo-tx-linux.git/commit
memcg: zap mem_cgroup_lookup()
authorVladimir Davydov <vdavydov@parallels.com>
Tue, 7 Apr 2015 23:44:22 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:22 +0000 (09:44 +1000)
commit37307f5837e56dd6c0186dfb55fdce43feb4f178
treed917d318cc07d27455e112eac6f738bda2aec69e
parent390b4b902b376284a57c1eae8eef560def2426da
memcg: zap mem_cgroup_lookup()

mem_cgroup_lookup() is a wrapper around mem_cgroup_from_id(), which checks
that id != 0 before issuing the function call.  Today, there is no point
in this additional check apart from optimization, because there is no css
with id <= 0, so that css_from_id, called by mem_cgroup_from_id, will
return NULL for any id <= 0.

Since mem_cgroup_from_id is only called from mem_cgroup_lookup, let us zap
mem_cgroup_lookup, substituting calls to it with mem_cgroup_from_id and
moving the check if id > 0 to css_from_id.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/cgroup.c
mm/memcontrol.c