linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] prevent to reclaim anon page of lumpy reclaim for no swap space
@ 2009-06-25  9:36 Minchan Kim
  2009-06-25 14:09 ` Rik van Riel
  2009-06-25 14:14 ` KOSAKI Motohiro
  0 siblings, 2 replies; 7+ messages in thread
From: Minchan Kim @ 2009-06-25  9:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Rik van Riel, KOSAKI Motohiro, KAMEZAWA Hiroyuki, linux-mm, lkml

This patch prevent to reclaim anon page in case of no swap space.
VM already prevent to reclaim anon page in various place.
But it doesnt't prevent it for lumpy reclaim.

It shuffles lru list unnecessary so that it is pointless.
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
 mm/vmscan.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 026f452..fb401fe 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -830,7 +830,13 @@ int __isolate_lru_page(struct page *page, int mode, int file)
 	 * When this function is being called for lumpy reclaim, we
 	 * initially look into all LRU pages, active, inactive and
 	 * unevictable; only give shrink_page_list evictable pages.
+
+	 * If we don't have enough swap space, reclaiming of anon page
+	 * is pointless.
 	 */
+	if (nr_swap_pages <= 0 && PageAnon(page))
+		return ret;
+
 	if (PageUnevictable(page))
 		return ret;
 
-- 
1.5.4.3




-- 
Kinds Regards
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2009-06-25 15:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-25  9:36 [PATCH] prevent to reclaim anon page of lumpy reclaim for no swap space Minchan Kim
2009-06-25 14:09 ` Rik van Riel
2009-06-25 14:30   ` Minchan Kim
2009-06-25 14:14 ` KOSAKI Motohiro
2009-06-25 14:44   ` Minchan Kim
2009-06-25 14:54     ` Lee Schermerhorn
2009-06-25 15:03       ` Minchan Kim

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