rk: lowmemorykiller: calculator free pages exclude CMA's free
authorCMY <cmy@rock-chips.com>
Mon, 23 Jun 2014 02:11:35 +0000 (10:11 +0800)
committerCMY <cmy@rock-chips.com>
Mon, 23 Jun 2014 02:11:35 +0000 (10:11 +0800)
drivers/staging/android/lowmemorykiller.c

index a56e0894f66871752d7e9df73653edbc87184b8a..db571b8f0c8d961749e8599b2bcd55b96ee76b3d 100644 (file)
@@ -77,7 +77,8 @@ static int lowmem_shrink(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);