aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2012-01-12 20:18:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 23:13:05 -0500
commite94c8a9cbce1aee4af9e1285802785481b7f93c5 (patch)
tree14d496e62c2e8d59a8954ff10368d59d8dfaea03 /include
parent6b208e3f6e35aa76d254c395bdcd984b17c6b626 (diff)
memcg: make mem_cgroup_split_huge_fixup() more efficient
In split_huge_page(), mem_cgroup_split_huge_fixup() is called to handle page_cgroup modifcations. It takes move_lock_page_cgroup() and modifies page_cgroup and LRU accounting jobs and called HPAGE_PMD_SIZE - 1 times. But thinking again, - compound_lock() is held at move_accout...then, it's not necessary to take move_lock_page_cgroup(). - LRU is locked and all tail pages will go into the same LRU as head is now on. - page_cgroup is contiguous in huge page range. This patch fixes mem_cgroup_split_huge_fixup() as to be called once per hugepage and reduce costs for spliting. [akpm@linux-foundation.org: fix typo, per Michal] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Andrea Arcangeli <aarcange@redhat.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: Balbir Singh <bsingharora@gmail.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/memcontrol.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index e2f8e7caf04b..cee3761666f0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -163,7 +163,7 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
163 163
164void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 164void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
165#ifdef CONFIG_TRANSPARENT_HUGEPAGE 165#ifdef CONFIG_TRANSPARENT_HUGEPAGE
166void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); 166void mem_cgroup_split_huge_fixup(struct page *head);
167#endif 167#endif
168 168
169#ifdef CONFIG_DEBUG_VM 169#ifdef CONFIG_DEBUG_VM
@@ -379,8 +379,7 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
379 return 0; 379 return 0;
380} 380}
381 381
382static inline void mem_cgroup_split_huge_fixup(struct page *head, 382static inline void mem_cgroup_split_huge_fixup(struct page *head)
383 struct page *tail)
384{ 383{
385} 384}
386 385