Vladimir Davydov 4bdfc1c4a9 memcg: fix destination cgroup leak on task charges migration
We are supposed to take one css reference per each memory page and per
each swap entry accounted to a memory cgroup.  However, during task
charges migration we take a reference to the destination cgroup twice
per each swap entry: first in mem_cgroup_do_precharge()->try_charge()
and then in mem_cgroup_move_swap_account(), permanently leaking the
destination cgroup.

The hunk taking the second reference seems to be a leftover from the
pre-00501b531c472 ("mm: memcontrol: rewrite charge API") era.  Remove it
to fix the leak.

Fixes: e8ea14cc6ead (mm: memcontrol: take a css reference for each charged page)
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: 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>
2015-01-08 15:10:52 -08:00
..
2014-12-18 19:08:10 -08:00
2012-01-03 22:54:56 -05:00
2014-12-13 12:42:45 -08:00
2011-07-26 16:49:47 -07:00
2014-12-08 20:25:23 -05:00
2014-12-17 08:26:51 -05:00
2014-01-27 21:02:39 -08:00
2014-10-09 22:25:58 -04:00
2014-10-29 10:34:34 -04:00
2014-12-17 06:43:56 -05:00
2014-08-29 16:28:16 -07:00