summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaitik Bharadiya <bharad@codeaurora.org>2020-03-26 15:01:56 +0530
committerNaitik Bharadiya <bharad@codeaurora.org>2020-03-26 15:49:57 +0530
commita99886e77b364b77c4dd0dce8c5fa9e8e5f3e877 (patch)
treee19dc584b74991fbf410fb74354326ab26449a6e
parent0f793d310e340ee8873c413c3c828ae4642711d5 (diff)
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 <bharad@codeaurora.org>
-rw-r--r--drivers/staging/android/lowmemorykiller.c3
1 files changed, 3 insertions, 0 deletions
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);