From: zengtao <prime.z...@hisilicon.com>

when cma is enabled, the watermark caculation will
include the cma pages, while it can't use cma pages.
this will cause oom while lowmemory killer don't work.

Signed-off-by: zengtao <prime.z...@hisilicon.com>
---
 drivers/staging/android/lowmemorykiller.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 12f0a13..12cfd4f 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -74,7 +74,9 @@ static int lowmem_shrink(struct shrinker *s, struct 
shrink_control *sc)
        int selected_tasksize = 0;
        int 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) -
+                               global_page_state(NR_FREE_CMA_PAGES) -
+                               totalreserve_pages;
        int other_file = global_page_state(NR_FILE_PAGES) -
                                                global_page_state(NR_SHMEM);

--
1.7.0.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to