]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
staging: android: lowmemorykiller: neglect swap cached pages in other_file
authorVinayak Menon <vinayakm.list@gmail.com>
Wed, 26 Feb 2014 19:06:22 +0000 (00:36 +0530)
committerDhiren Parmar <dparmar@nvidia.com>
Mon, 29 Sep 2014 11:34:18 +0000 (04:34 -0700)
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.

Bug 200031574

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: Ic268437b65e89496244289adffa8bac80df88c28
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/497231
(cherry picked from commit 1eec4665e479908911713705e384da8a6d5b66b1)
(cherry picked from commit 29ed5bc606765584b30fa7d025c0d49a02a6e7e4)
Reviewed-on: http://git-master/r/539291
Reviewed-by: Dhiren Parmar <dparmar@nvidia.com>
drivers/staging/android/lowmemorykiller.c

index 2c72aec6bb4cc80d55df13f6b915192d1491b6e7..6ccd7bfe47f75c45d17c897ddd672ed9c826aab3 100644 (file)
@@ -86,7 +86,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
 #endif
                         ;
        int other_file = global_page_state(NR_FILE_PAGES) -
-                                               global_page_state(NR_SHMEM);
+                                               global_page_state(NR_SHMEM) -
+                                               total_swapcache_pages();
 
        if (lowmem_adj_size < array_size)
                array_size = lowmem_adj_size;