staging: android: lowmemorykiller: neglect swap cached pages in other_file
PATCH 1/1 staging: android: lowmemorykiller: neglect swap cached pages in other_file
From: Vinayak Menon <[email protected]>
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.
--- drivers/staging/android/lowmemorykiller.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/staging/android/lowmemorykiller.c +2 -1
@@ -88,7 +88,8 @@ static unsigned long lowmem_scan(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 ); + global_page_state(NR_SHMEM) +total_swapcache_pages ();if (lowmem_adj_size < array_size) array_size = lowmem_adj_size;
Signature · 1 line
1.7.6
Greg KH
maintainerQuoted 9 lines · On Wed, Feb 26, 2014 at 11:40:33PM +0530, [email protected] wrote:
From: Vinayak Menon <[email protected]>
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 toother_file. But these pages can't be reclaimed unless lowmemorykiller triggers. So subtract swap pages fromother_file.
Quoted 4 lines
Signed-off-by Vinayak Menon <[email protected]>--- drivers/staging/android/lowmemorykiller.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
You sent 2 patches, both different, which should I apply?
How about I delete both and wait for a proper "v3" that specifies exactly what is going on here...