From: CMY Date: Mon, 23 Jun 2014 02:11:35 +0000 (+0800) Subject: lowmemorykiller: calculator free pages exclude CMA's free X-Git-Tag: firefly_0821_release~3220 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1dea5fb1c2a95902f965bbf2c431990b3e3fb33e;p=firefly-linux-kernel-4.4.55.git lowmemorykiller: calculator free pages exclude CMA's free Change-Id: I51a08cd9c9ef8d37fd0a5f649c5d2843a8b7d9ff Signed-off-by: Jianqun Xu --- diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index af49af0cca01..e7fd1a39db65 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -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();