]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/vmscan.c
NVMe: Remove redundant version.h header include
[karo-tx-linux.git] / mm / vmscan.c
index e03a00b09da985629261007c0c84b2109b81d6bf..fa6a85378ee41400985aca748cd76b59c0f87594 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/vmpressure.h>
 #include <linux/vmstat.h>
 #include <linux/file.h>
 #include <linux/writeback.h>
@@ -780,7 +781,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
                if (PageAnon(page) && !PageSwapCache(page)) {
                        if (!(sc->gfp_mask & __GFP_IO))
                                goto keep_locked;
-                       if (!add_to_swap(page))
+                       if (!add_to_swap(page, page_list))
                                goto activate_locked;
                        may_enter_fs = 1;
                }
@@ -1982,6 +1983,11 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
                        }
                        memcg = mem_cgroup_iter(root, memcg, &reclaim);
                } while (memcg);
+
+               vmpressure(sc->gfp_mask, sc->target_mem_cgroup,
+                          sc->nr_scanned - nr_scanned,
+                          sc->nr_reclaimed - nr_reclaimed);
+
        } while (should_continue_reclaim(zone, sc->nr_reclaimed - nr_reclaimed,
                                         sc->nr_scanned - nr_scanned, sc));
 }
@@ -2167,6 +2173,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
                count_vm_event(ALLOCSTALL);
 
        do {
+               vmpressure_prio(sc->gfp_mask, sc->target_mem_cgroup,
+                               sc->priority);
                sc->nr_scanned = 0;
                aborted_reclaim = shrink_zones(zonelist, sc);