diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2011-01-20 17:44:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-20 20:02:06 -0500 |
commit | ca3e021417eed30ec2b64ce88eb0acf64aa9bc29 (patch) | |
tree | 710590e51764d56c12d00744c402ab15c0d14a6b /mm/huge_memory.c | |
parent | e401f1761c0b01966e36e41e2c385d455a7b44ee (diff) |
memcg: fix USED bit handling at uncharge in THP
Now, under THP:
at charge:
- PageCgroupUsed bit is set to all page_cgroup on a hugepage.
....set to 512 pages.
at uncharge
- PageCgroupUsed bit is unset on the head page.
So, some pages will remain with "Used" bit.
This patch fixes that Used bit is set only to the head page.
Used bits for tail pages will be set at splitting if necessary.
This patch adds this lock order:
compound_lock() -> page_cgroup_move_lock().
[akpm@linux-foundation.org: fix warning]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r-- | mm/huge_memory.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c4f634b3a48e..e187454d82f6 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1203,6 +1203,8 @@ static void __split_huge_page_refcount(struct page *page) | |||
1203 | BUG_ON(!PageDirty(page_tail)); | 1203 | BUG_ON(!PageDirty(page_tail)); |
1204 | BUG_ON(!PageSwapBacked(page_tail)); | 1204 | BUG_ON(!PageSwapBacked(page_tail)); |
1205 | 1205 | ||
1206 | mem_cgroup_split_huge_fixup(page, page_tail); | ||
1207 | |||
1206 | lru_add_page_tail(zone, page, page_tail); | 1208 | lru_add_page_tail(zone, page, page_tail); |
1207 | } | 1209 | } |
1208 | 1210 | ||