]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/swap_state.c
mm: thp: add split tail pages to shrink page list in page reclaim
[mirror_ubuntu-zesty-kernel.git] / mm / swap_state.c
index 7efcf1525921037d434060f73c0ff77b9981e02c..b3d40dcf36247975ac05b1f7a7119521e7cb65bb 100644 (file)
@@ -78,7 +78,7 @@ void show_swap_cache_info(void)
  * __add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,
  * but sets SwapCache flag and private instead of mapping and index.
  */
-static int __add_to_swap_cache(struct page *page, swp_entry_t entry)
+int __add_to_swap_cache(struct page *page, swp_entry_t entry)
 {
        int error;
        struct address_space *address_space;
@@ -160,7 +160,7 @@ void __delete_from_swap_cache(struct page *page)
  * Allocate swap space for the page and add the page to the
  * swap cache.  Caller needs to hold the page lock. 
  */
-int add_to_swap(struct page *page)
+int add_to_swap(struct page *page, struct list_head *list)
 {
        swp_entry_t entry;
        int err;
@@ -173,7 +173,7 @@ int add_to_swap(struct page *page)
                return 0;
 
        if (unlikely(PageTransHuge(page)))
-               if (unlikely(split_huge_page(page))) {
+               if (unlikely(split_huge_page_to_list(page, list))) {
                        swapcache_free(entry, NULL);
                        return 0;
                }