diff options
Diffstat (limited to 'mm/swap.c')
-rw-r--r-- | mm/swap.c | 35 |
1 files changed, 24 insertions, 11 deletions
@@ -76,7 +76,7 @@ static void __page_cache_release(struct page *page) | |||
76 | static void __put_single_page(struct page *page) | 76 | static void __put_single_page(struct page *page) |
77 | { | 77 | { |
78 | __page_cache_release(page); | 78 | __page_cache_release(page); |
79 | free_hot_cold_page(page, false); | 79 | free_unref_page(page); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void __put_compound_page(struct page *page) | 82 | static void __put_compound_page(struct page *page) |
@@ -210,7 +210,7 @@ static void pagevec_lru_move_fn(struct pagevec *pvec, | |||
210 | } | 210 | } |
211 | if (pgdat) | 211 | if (pgdat) |
212 | spin_unlock_irqrestore(&pgdat->lru_lock, flags); | 212 | spin_unlock_irqrestore(&pgdat->lru_lock, flags); |
213 | release_pages(pvec->pages, pvec->nr, pvec->cold); | 213 | release_pages(pvec->pages, pvec->nr); |
214 | pagevec_reinit(pvec); | 214 | pagevec_reinit(pvec); |
215 | } | 215 | } |
216 | 216 | ||
@@ -740,7 +740,7 @@ void lru_add_drain_all(void) | |||
740 | * Decrement the reference count on all the pages in @pages. If it | 740 | * Decrement the reference count on all the pages in @pages. If it |
741 | * fell to zero, remove the page from the LRU and free it. | 741 | * fell to zero, remove the page from the LRU and free it. |
742 | */ | 742 | */ |
743 | void release_pages(struct page **pages, int nr, bool cold) | 743 | void release_pages(struct page **pages, int nr) |
744 | { | 744 | { |
745 | int i; | 745 | int i; |
746 | LIST_HEAD(pages_to_free); | 746 | LIST_HEAD(pages_to_free); |
@@ -817,7 +817,7 @@ void release_pages(struct page **pages, int nr, bool cold) | |||
817 | spin_unlock_irqrestore(&locked_pgdat->lru_lock, flags); | 817 | spin_unlock_irqrestore(&locked_pgdat->lru_lock, flags); |
818 | 818 | ||
819 | mem_cgroup_uncharge_list(&pages_to_free); | 819 | mem_cgroup_uncharge_list(&pages_to_free); |
820 | free_hot_cold_page_list(&pages_to_free, cold); | 820 | free_unref_page_list(&pages_to_free); |
821 | } | 821 | } |
822 | EXPORT_SYMBOL(release_pages); | 822 | EXPORT_SYMBOL(release_pages); |
823 | 823 | ||
@@ -833,8 +833,11 @@ EXPORT_SYMBOL(release_pages); | |||
833 | */ | 833 | */ |
834 | void __pagevec_release(struct pagevec *pvec) | 834 | void __pagevec_release(struct pagevec *pvec) |
835 | { | 835 | { |
836 | lru_add_drain(); | 836 | if (!pvec->percpu_pvec_drained) { |
837 | release_pages(pvec->pages, pagevec_count(pvec), pvec->cold); | 837 | lru_add_drain(); |
838 | pvec->percpu_pvec_drained = true; | ||
839 | } | ||
840 | release_pages(pvec->pages, pagevec_count(pvec)); | ||
838 | pagevec_reinit(pvec); | 841 | pagevec_reinit(pvec); |
839 | } | 842 | } |
840 | EXPORT_SYMBOL(__pagevec_release); | 843 | EXPORT_SYMBOL(__pagevec_release); |
@@ -986,15 +989,25 @@ unsigned pagevec_lookup_range(struct pagevec *pvec, | |||
986 | } | 989 | } |
987 | EXPORT_SYMBOL(pagevec_lookup_range); | 990 | EXPORT_SYMBOL(pagevec_lookup_range); |
988 | 991 | ||
989 | unsigned pagevec_lookup_tag(struct pagevec *pvec, struct address_space *mapping, | 992 | unsigned pagevec_lookup_range_tag(struct pagevec *pvec, |
990 | pgoff_t *index, int tag, unsigned nr_pages) | 993 | struct address_space *mapping, pgoff_t *index, pgoff_t end, |
994 | int tag) | ||
991 | { | 995 | { |
992 | pvec->nr = find_get_pages_tag(mapping, index, tag, | 996 | pvec->nr = find_get_pages_range_tag(mapping, index, end, tag, |
993 | nr_pages, pvec->pages); | 997 | PAGEVEC_SIZE, pvec->pages); |
994 | return pagevec_count(pvec); | 998 | return pagevec_count(pvec); |
995 | } | 999 | } |
996 | EXPORT_SYMBOL(pagevec_lookup_tag); | 1000 | EXPORT_SYMBOL(pagevec_lookup_range_tag); |
997 | 1001 | ||
1002 | unsigned pagevec_lookup_range_nr_tag(struct pagevec *pvec, | ||
1003 | struct address_space *mapping, pgoff_t *index, pgoff_t end, | ||
1004 | int tag, unsigned max_pages) | ||
1005 | { | ||
1006 | pvec->nr = find_get_pages_range_tag(mapping, index, end, tag, | ||
1007 | min_t(unsigned int, max_pages, PAGEVEC_SIZE), pvec->pages); | ||
1008 | return pagevec_count(pvec); | ||
1009 | } | ||
1010 | EXPORT_SYMBOL(pagevec_lookup_range_nr_tag); | ||
998 | /* | 1011 | /* |
999 | * Perform any setup for the swap system | 1012 | * Perform any setup for the swap system |
1000 | */ | 1013 | */ |