public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file
@ 2014-02-26 18:10 vinayakm.list
  2014-02-26 18:27 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: vinayakm.list @ 2014-02-26 18:10 UTC (permalink / raw)
  To: gregkh, arve, akpm; +Cc: linux-kernel, Vinayak Menon

From: Vinayak Menon <vinayakm.list@gmail.com>

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>
---
 drivers/staging/android/lowmemorykiller.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 6f094b3..92b1c93 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -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;
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file
@ 2014-02-26 18:15 vinayakm.list
  0 siblings, 0 replies; 3+ messages in thread
From: vinayakm.list @ 2014-02-26 18:15 UTC (permalink / raw)
  To: gregkh, arve, akpm; +Cc: linux-kernel, Vinayak Menon

From: Vinayak Menon <vinayakm.list@gmail.com>

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>
---
 drivers/staging/android/lowmemorykiller.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index 6f094b3..9e931b2 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -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;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file
  2014-02-26 18:10 [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file vinayakm.list
@ 2014-02-26 18:27 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2014-02-26 18:27 UTC (permalink / raw)
  To: vinayakm.list; +Cc: arve, akpm, linux-kernel

On Wed, Feb 26, 2014 at 11:40:33PM +0530, vinayakm.list@gmail.com wrote:
> From: Vinayak Menon <vinayakm.list@gmail.com>
> 
> 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>
> ---
>  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...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-26 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26 18:10 [PATCH] staging: android: lowmemorykiller: neglect swap cached pages in other_file vinayakm.list
2014-02-26 18:27 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2014-02-26 18:15 vinayakm.list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox