diff options
Diffstat (limited to 'mm/swap.c')
-rw-r--r-- | mm/swap.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -62,6 +62,7 @@ static void __page_cache_release(struct page *page) | |||
62 | del_page_from_lru_list(page, lruvec, page_off_lru(page)); | 62 | del_page_from_lru_list(page, lruvec, page_off_lru(page)); |
63 | spin_unlock_irqrestore(&zone->lru_lock, flags); | 63 | spin_unlock_irqrestore(&zone->lru_lock, flags); |
64 | } | 64 | } |
65 | mem_cgroup_uncharge(page); | ||
65 | } | 66 | } |
66 | 67 | ||
67 | static void __put_single_page(struct page *page) | 68 | static void __put_single_page(struct page *page) |
@@ -907,6 +908,8 @@ void release_pages(struct page **pages, int nr, bool cold) | |||
907 | struct lruvec *lruvec; | 908 | struct lruvec *lruvec; |
908 | unsigned long uninitialized_var(flags); | 909 | unsigned long uninitialized_var(flags); |
909 | 910 | ||
911 | mem_cgroup_uncharge_start(); | ||
912 | |||
910 | for (i = 0; i < nr; i++) { | 913 | for (i = 0; i < nr; i++) { |
911 | struct page *page = pages[i]; | 914 | struct page *page = pages[i]; |
912 | 915 | ||
@@ -938,6 +941,7 @@ void release_pages(struct page **pages, int nr, bool cold) | |||
938 | __ClearPageLRU(page); | 941 | __ClearPageLRU(page); |
939 | del_page_from_lru_list(page, lruvec, page_off_lru(page)); | 942 | del_page_from_lru_list(page, lruvec, page_off_lru(page)); |
940 | } | 943 | } |
944 | mem_cgroup_uncharge(page); | ||
941 | 945 | ||
942 | /* Clear Active bit in case of parallel mark_page_accessed */ | 946 | /* Clear Active bit in case of parallel mark_page_accessed */ |
943 | __ClearPageActive(page); | 947 | __ClearPageActive(page); |
@@ -947,6 +951,8 @@ void release_pages(struct page **pages, int nr, bool cold) | |||
947 | if (zone) | 951 | if (zone) |
948 | spin_unlock_irqrestore(&zone->lru_lock, flags); | 952 | spin_unlock_irqrestore(&zone->lru_lock, flags); |
949 | 953 | ||
954 | mem_cgroup_uncharge_end(); | ||
955 | |||
950 | free_hot_cold_page_list(&pages_to_free, cold); | 956 | free_hot_cold_page_list(&pages_to_free, cold); |
951 | } | 957 | } |
952 | EXPORT_SYMBOL(release_pages); | 958 | EXPORT_SYMBOL(release_pages); |