Daisuke Nishimura 50de1dd967 memcg: fix memory migration of shmem swapcache
In the current implementation mem_cgroup_end_migration() decides whether
the page migration has succeeded or not by checking "oldpage->mapping".

But if we are tring to migrate a shmem swapcache, the page->mapping of it
is NULL from the begining, so the check would be invalid.  As a result,
mem_cgroup_end_migration() assumes the migration has succeeded even if
it's not, so "newpage" would be freed while it's not uncharged.

This patch fixes it by passing mem_cgroup_end_migration() the result of
the page migration.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-13 17:32:51 -08:00
..
2010-08-08 21:57:23 +01:00
2011-01-13 17:32:49 -08:00
2011-01-13 17:32:42 -08:00
2011-01-13 17:32:43 -08:00
2011-01-13 17:32:47 -08:00
2011-01-13 17:32:46 -08:00
2011-01-13 17:32:41 -08:00
2011-01-13 17:32:41 -08:00
2011-01-07 17:50:26 +11:00
2011-01-13 17:32:33 -08:00
2011-01-13 17:32:43 -08:00
2011-01-13 17:32:41 -08:00
2011-01-13 17:32:41 -08:00
2011-01-13 17:32:36 -08:00
2011-01-13 17:32:43 -08:00