diff options
-rw-r--r-- | mm/memcontrol.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 13e9e7d8e49e..66d0e84cefa6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -665,15 +665,15 @@ void mem_cgroup_uncharge_page(struct page *page) | |||
665 | page_assign_page_cgroup(page, NULL); | 665 | page_assign_page_cgroup(page, NULL); |
666 | unlock_page_cgroup(page); | 666 | unlock_page_cgroup(page); |
667 | 667 | ||
668 | mem = pc->mem_cgroup; | ||
669 | css_put(&mem->css); | ||
670 | res_counter_uncharge(&mem->res, PAGE_SIZE); | ||
671 | |||
672 | mz = page_cgroup_zoneinfo(pc); | 668 | mz = page_cgroup_zoneinfo(pc); |
673 | spin_lock_irqsave(&mz->lru_lock, flags); | 669 | spin_lock_irqsave(&mz->lru_lock, flags); |
674 | __mem_cgroup_remove_list(pc); | 670 | __mem_cgroup_remove_list(pc); |
675 | spin_unlock_irqrestore(&mz->lru_lock, flags); | 671 | spin_unlock_irqrestore(&mz->lru_lock, flags); |
676 | 672 | ||
673 | mem = pc->mem_cgroup; | ||
674 | res_counter_uncharge(&mem->res, PAGE_SIZE); | ||
675 | css_put(&mem->css); | ||
676 | |||
677 | kfree(pc); | 677 | kfree(pc); |
678 | return; | 678 | return; |
679 | } | 679 | } |
@@ -774,9 +774,9 @@ retry: | |||
774 | if (page_get_page_cgroup(page) == pc) { | 774 | if (page_get_page_cgroup(page) == pc) { |
775 | page_assign_page_cgroup(page, NULL); | 775 | page_assign_page_cgroup(page, NULL); |
776 | unlock_page_cgroup(page); | 776 | unlock_page_cgroup(page); |
777 | css_put(&mem->css); | ||
778 | res_counter_uncharge(&mem->res, PAGE_SIZE); | ||
779 | __mem_cgroup_remove_list(pc); | 777 | __mem_cgroup_remove_list(pc); |
778 | res_counter_uncharge(&mem->res, PAGE_SIZE); | ||
779 | css_put(&mem->css); | ||
780 | kfree(pc); | 780 | kfree(pc); |
781 | } else { | 781 | } else { |
782 | /* racing uncharge: let page go then retry */ | 782 | /* racing uncharge: let page go then retry */ |