aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinayak Menon <vinayakm.list@gmail.com>2014-02-27 00:36:22 +0530
committerMister Oyster <oysterized@gmail.com>2017-09-18 19:19:24 +0200
commita12f5e8b83fe7f09b9abceb01811ac6180377f96 (patch)
treedad2452ccc0002dacf634d4455b84b495e3d767d
parentfdcfa35b71de9310356934bbca834c04c94dad62 (diff)
staging: android: lowmemorykiller: neglect swap cached pages in other_file
With ZRAM enabled it is observed that lowmemory killer doesn't trigger properly. swap cached pages are accounted in NR_FILE, and lowmemorykiller considers this as reclaimable and adds to other_file. But these pages can't be reclaimed unless lowmemorykiller triggers. So subtract swap pages from other_file. Signed-off-by: Vinayak Menon <vinayakm.list@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 058dbde928597e7a8bd04e28e77e5cfc4270591d) Change-Id: I217e831bbe1db830e6d61c7943e442a32a7548a1 Reverts some Mediatek customisation to lmk Signed-off-by: Mister Oyster <oysterized@gmail.com>
-rw-r--r--drivers/staging/android/lowmemorykiller.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index c2c3e786e..843a7a224 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -95,11 +95,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
int array_size = ARRAY_SIZE(lowmem_adj);
int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
int other_file = global_page_state(NR_FILE_PAGES) -
- global_page_state(NR_SHMEM);
-
-#ifdef CONFIG_ZRAM
- other_file -= total_swapcache_pages();
-#endif
+ global_page_state(NR_SHMEM) -
+ total_swapcache_pages();
if (lowmem_adj_size < array_size)
array_size = lowmem_adj_size;