From: Zeng Tao <[email protected]> Date: Tue, 5 Aug 2014 17:58:10 +0800 Subject: [PATCH] drivers: android: fix watermark when cma enabled
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: Zeng Tao <[email protected]> --- 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 -----邮件原件----- 发件人: Dan Carpenter [mailto:[email protected]] 发送时间: 2014年8月5日 18:36 收件人: Zengtao (B) 抄送: [email protected]; [email protected] 主题: Re: [PATCH] drivers: android: fix watermark when cma enabled On Tue, Aug 05, 2014 at 09:43:48AM +0000, Zengtao (B) wrote: > From: zengtao <[email protected]> This is for when you are sending patches on behalf of someone else. Just fix your from header. Use your real name. Zeng Tao? > > 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 <[email protected]> Real name again. regards, dan carpenter _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
