mm: memcontrol: remove ordering between pc->mem_cgroup and PageCgroupUsed
authorJohannes Weiner <[email protected]>
Wed, 6 Aug 2014 23:06:01 +0000 (16:06 -0700)
committerLinus Torvalds <[email protected]>
Thu, 7 Aug 2014 01:01:17 +0000 (18:01 -0700)
commit9a2385eef9f28fb5260c48c45fc8fe01f1da70a6
tree1bd5538a1901519316b5b59f73dbf3ed508a8501
parent05b8430123359886ef6a4146fba384e30d771b3f
mm: memcontrol: remove ordering between pc->mem_cgroup and PageCgroupUsed

There is a write barrier between setting pc->mem_cgroup and
PageCgroupUsed, which was added to allow LRU operations to lookup the
memcg LRU list of a page without acquiring the page_cgroup lock.

But ever since commit 38c5d72f3ebe ("memcg: simplify LRU handling by new
rule"), pages are ensured to be off-LRU while charging, so nobody else
is changing LRU state while pc->mem_cgroup is being written, and there
are no read barriers anymore.

Remove the unnecessary write barrier.

Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memcontrol.c