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-07 10:23:34 +01:00
2009-03-31 09:56:26 +01:00
2009-04-01 08:59:23 -07:00
2009-04-01 08:59:23 -07:00
2009-05-02 15:36:10 -07:00
2009-04-22 08:35:10 +02:00
2009-04-23 10:06:35 +01:00
2009-04-03 14:53:32 -07:00
2009-05-29 08:40:01 -07:00
2009-04-03 14:53:32 -07:00
2009-04-03 09:48:29 -07:00
2009-05-22 16:23:38 +02:00
2009-04-02 19:04:53 -07:00
2009-04-13 15:04:29 -07:00
2009-04-21 13:41:48 -07:00
2009-04-21 13:41:48 -07:00
2009-05-09 10:49:41 -04:00
2009-04-06 16:06:26 +01:00
2009-04-01 08:59:17 -07:00
2009-04-07 08:12:38 +02:00
2009-04-02 19:04:48 -07:00
2009-04-03 17:41:23 -07:00
2009-04-01 13:28:15 -04:00
2009-04-03 17:41:12 -07:00
2009-04-30 15:32:11 +00:00
2009-04-01 08:59:13 -07:00
2009-04-01 08:59:13 -07:00
2009-04-13 14:51:23 -07:00
2009-04-24 08:54:21 +02:00
2009-04-01 08:59:13 -07:00
2009-03-30 14:28:58 -07:00
2009-05-09 10:49:41 -04:00
2009-04-01 08:59:24 -07:00
2009-04-08 14:33:38 -07:00
2009-04-13 15:04:29 -07:00
2009-04-03 12:23:06 +02:00
2009-04-21 19:40:00 -07:00
2009-04-03 12:23:06 +02:00
2009-04-02 19:05:01 -07:00
2009-04-17 10:50:27 -07:00