Daisuke Nishimura 57f9fd7d25 memcg: cleanup mem_cgroup_move_parent()
mem_cgroup_move_parent() calls try_charge first and cancel_charge on
failure.  IMHO, charge/uncharge(especially charge) is high cost operation,
so we should avoid it as far as possible.

This patch tries to delay try_charge in mem_cgroup_move_parent() by
re-ordering checks it does.

And this patch renames mem_cgroup_move_account() to
__mem_cgroup_move_account(), changes the return value of
__mem_cgroup_move_account() from int to void, and adds a new
wrapper(mem_cgroup_move_account()), which checks whether a @pc is valid
for moving account and calls __mem_cgroup_move_account().

This patch removes the last caller of trylock_page_cgroup(), so removes
its definition too.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16 07:20:07 -08:00
..
2009-12-03 13:49:43 +01:00
2009-04-01 08:59:13 -07:00
2009-12-10 15:02:50 +01:00
2009-06-16 19:47:28 -07:00
2009-12-15 08:53:20 -08:00
2009-10-02 13:29:29 +09:00
2009-12-15 08:53:17 -08:00
2009-09-22 07:17:35 -07:00
2009-12-15 08:53:16 -08:00
2007-10-20 01:27:18 +02:00
2009-12-15 08:53:16 -08:00
2009-12-15 08:53:19 -08:00
2009-06-23 12:50:05 -07:00
2009-12-15 08:53:21 -08:00