KAMEZAWA Hiroyuki 073e587ec2 memcg: move charge swapin under lock
While page-cache's charge/uncharge is done under page_lock(), swap-cache
isn't.  (anonymous page is charged when it's newly allocated.)

This patch moves do_swap_page()'s charge() call under lock.  I don't see
any bad problem *now* but this fix will be good for future for avoiding
unnecessary racy state.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Acked-by: 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>
2008-10-20 08:52:38 -07:00
..
2008-10-20 08:52:32 -07:00
2008-10-20 08:52:32 -07:00
2008-10-20 08:50:26 -07:00
2008-10-20 08:50:26 -07:00
2008-10-20 08:52:38 -07:00
2008-10-20 08:50:26 -07:00
2008-10-20 08:52:32 -07:00
2008-10-20 08:52:30 -07:00
2008-10-20 08:52:31 -07:00
2008-10-20 08:50:26 -07:00
2008-10-20 08:52:32 -07:00
2008-10-20 08:52:32 -07:00
2008-10-20 08:52:32 -07:00