]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: sanitize __mem_cgroup_try_charge() call protocol
authorJohannes Weiner <hannes@cmpxchg.org>
Mon, 7 Apr 2014 22:37:45 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:35:57 +0000 (16:35 -0700)
commitc1f1e6d820cc7e3fbf705f81378576110a5ad1cf
treed91eba708cf20e7cda0913bb3489df0ae31f5315
parent8ec253119149b5b14cac5a0056c8f4d9dade7be9
memcg: sanitize __mem_cgroup_try_charge() call protocol

Some callsites pass a memcg directly, some callsites pass an mm that
then has to be translated to a memcg.  This makes for a terrible
function interface.

Just push the mm-to-memcg translation into the respective callsites and
always pass a memcg to mem_cgroup_try_charge().

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