memcg: check for proper lock held in mem_cgroup_update_page_stat
authorSha Zhengju <[email protected]>
Thu, 12 Sep 2013 22:13:52 +0000 (15:13 -0700)
committerLinus Torvalds <[email protected]>
Thu, 12 Sep 2013 22:38:02 +0000 (15:38 -0700)
commit658b72c5a7a033f0dde61b15dff86bf423ce425e
tree271352bf3a3c5ad13acca1ca425dfb8b53d1e190
parent68b4876d996e8749142b2895bc2e251448996363
memcg: check for proper lock held in mem_cgroup_update_page_stat

We should call mem_cgroup_begin_update_page_stat() before
mem_cgroup_update_page_stat() to get proper locks, however the latter
doesn't do any checking that we use proper locking, which would be hard.
Suggested by Michal Hock we could at least test for rcu_read_lock_held()
because RCU is held if !mem_cgroup_disabled().

Signed-off-by: Sha Zhengju <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Reviewed-by: Greg Thelen <[email protected]>
Cc: Fengguang Wu <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memcontrol.c