lowmemorykiller: calculator free pages exclude CMA's free
[firefly-linux-kernel-4.4.55.git] / drivers / staging / android / lowmemorykiller.c
index af49af0cca01ba4231ee0fc564cf56987371959d..e7fd1a39db657b54706fd82c57a8c9219e4380f1 100644 (file)
@@ -91,7 +91,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
        int selected_tasksize = 0;
        short selected_oom_score_adj;
        int array_size = ARRAY_SIZE(lowmem_adj);
-       int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
+       int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages
+                                       - global_page_state(NR_FREE_CMA_PAGES);
        int other_file = global_page_state(NR_FILE_PAGES) -
                                                global_page_state(NR_SHMEM) -
                                                total_swapcache_pages();