Browse files

staging: android: lowmemorykiller: neglect swap cached pages in other…


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 <>
Signed-off-by: Greg Kroah-Hartman <>
(cherry picked from commit 058dbde928597e7a8bd04e28e77e5cfc4270591d)

Change-Id: I217e831bbe1db830e6d61c7943e442a32a7548a1
  • Loading branch information...
vinayakmenon authored and Thierry Strudel committed Feb 26, 2014
1 parent 22489c2 commit 985f2abdb279dfc47df9f4d9343055a04fcb2344
Showing with 2 additions and 1 deletion.
  1. +2 −1 drivers/staging/android/lowmemorykiller.c
@@ -82,7 +82,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) -
if (lowmem_adj_size < array_size)
array_size = lowmem_adj_size;

0 comments on commit 985f2ab

Please sign in to comment.