Daisuke Nishimura e767e0561d memcg: fix deadlock between lock_page_cgroup and mapping tree_lock
mapping->tree_lock can be acquired from interrupt context.  Then,
following dead lock can occur.

Assume "A" as a page.

 CPU0:
       lock_page_cgroup(A)
		interrupted
			-> take mapping->tree_lock.
 CPU1:
       take mapping->tree_lock
		-> lock_page_cgroup(A)

This patch tries to fix above deadlock by moving memcg's hook to out of
mapping->tree_lock.  charge/uncharge of pagecache/swapcache is protected
by page lock, not tree_lock.

After this patch, lock_page_cgroup() is not called under mapping->tree_lock.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-05-29 08:40:02 -07:00
..
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:14 -07:00
2009-04-01 08:59:13 -07:00
2009-05-02 15:36:09 -07:00
2007-10-20 01:27:18 +02:00
2008-07-28 16:30:21 -07:00
2008-06-12 18:05:41 -07:00
2007-10-20 01:27:18 +02:00
2009-05-21 13:14:32 -07:00
2009-05-02 15:36:09 -07:00
2009-05-06 10:23:17 +03:00
2009-04-13 15:04:32 -07:00
2009-05-06 16:36:10 -07:00