From a99886e77b364b77c4dd0dce8c5fa9e8e5f3e877 Mon Sep 17 00:00:00 2001 From: Naitik Bharadiya Date: Thu, 26 Mar 2020 15:01:56 +0530 Subject: android: lowmemorykiller: consider unevictable pages Due to not considering unevictable pages, vmpressure < 95 is getting ignored.This builds up the reclaim pressure causing direct reclaims, that in turn results in vmpressure 100 causing a series of kills so, consider unevictable pages in vmpressure notifier to avoid lowmemorykiller trigger. Change-Id: Ic26dc76b92b4bbc885c3f40c85f3d6f03a7696e9 Signed-off-by: Naitik Bharadiya --- drivers/staging/android/lowmemorykiller.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index 80070f67a895..ee4c11b4e164 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers/staging/android/lowmemorykiller.c @@ -294,6 +294,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb, if (pressure >= 95) { other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() - global_page_state(NR_SHMEM) - + global_page_state(NR_UNEVICTABLE) - total_swapcache_pages(); other_free = global_page_state(NR_FREE_PAGES); @@ -307,6 +308,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb, other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() - global_page_state(NR_SHMEM) - + global_page_state(NR_UNEVICTABLE) - total_swapcache_pages(); other_free = global_page_state(NR_FREE_PAGES); @@ -319,6 +321,7 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb, } else if (atomic_read(&shift_adj)) { other_file = global_page_state(NR_FILE_PAGES) + zcache_pages() - global_page_state(NR_SHMEM) - + global_page_state(NR_UNEVICTABLE) - total_swapcache_pages(); other_free = global_page_state(NR_FREE_PAGES); -- cgit v1.2.3