diff options
author | Michal Hocko <mhocko@suse.cz> | 2014-12-10 18:43:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:07 -0500 |
commit | b9982f8d27f893de2e8e98a25c68bb838b5311a4 (patch) | |
tree | 3848656f59dc14ab93475945c88590b63b7312f0 /mm/memcontrol.c | |
parent | 8c0145b62ef7e9019ab39284ed88873c483c8003 (diff) |
mm: memcontrol: micro-optimize mem_cgroup_split_huge_fixup()
Don't call lookup_page_cgroup() when memcg is disabled.
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 420461bcaefd..8c10d4ca9c3f 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -3174,7 +3174,7 @@ static inline void memcg_unregister_all_caches(struct mem_cgroup *memcg) | |||
3174 | */ | 3174 | */ |
3175 | void mem_cgroup_split_huge_fixup(struct page *head) | 3175 | void mem_cgroup_split_huge_fixup(struct page *head) |
3176 | { | 3176 | { |
3177 | struct page_cgroup *head_pc = lookup_page_cgroup(head); | 3177 | struct page_cgroup *head_pc; |
3178 | struct page_cgroup *pc; | 3178 | struct page_cgroup *pc; |
3179 | struct mem_cgroup *memcg; | 3179 | struct mem_cgroup *memcg; |
3180 | int i; | 3180 | int i; |
@@ -3182,6 +3182,8 @@ void mem_cgroup_split_huge_fixup(struct page *head) | |||
3182 | if (mem_cgroup_disabled()) | 3182 | if (mem_cgroup_disabled()) |
3183 | return; | 3183 | return; |
3184 | 3184 | ||
3185 | head_pc = lookup_page_cgroup(head); | ||
3186 | |||
3185 | memcg = head_pc->mem_cgroup; | 3187 | memcg = head_pc->mem_cgroup; |
3186 | for (i = 1; i < HPAGE_PMD_NR; i++) { | 3188 | for (i = 1; i < HPAGE_PMD_NR; i++) { |
3187 | pc = head_pc + i; | 3189 | pc = head_pc + i; |