linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2][mmotm-2009-0625-1549]  prevent to reclaim anon page of lumpy reclaim for no swap space
@ 2009-06-27  4:11 Minchan Kim
  0 siblings, 0 replies; only message in thread
From: Minchan Kim @ 2009-06-27  4:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, KOSAKI Motohiro, Rik van Riel, KAMEZAWA Hiroyuki,
	linux-mm, lkml

Since v1. 
 * fix - prevent anon page which already don't have swap slot
	 (by Rik van Riel suggestion)
 * change some comment

== CUT HERE ==

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.

__isolate_lru_page is called on slow path so that some condition
check could be not critical about performance.

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

--- mm/vmscan.c.orig	2009-06-27 12:30:41.000000000 +0900
+++ mm/vmscan.c	2009-06-27 12:32:00.000000000 +0900
@@ -830,7 +830,13 @@ int __isolate_lru_page(struct page *page
 	 * 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
+	 * which don't already have a swap slot is pointless.
 	 */
+	if (nr_swap_pages <= 0 && (PageAnon(page) && !PageSwapCache(page)))
+		return ret;
+
 	if (PageUnevictable(page))
 		return ret;
 

-- 
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] only message in thread

only message in thread, other threads:[~2009-06-27  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-27  4:11 [PATCH v2][mmotm-2009-0625-1549] prevent to reclaim anon page of lumpy reclaim for no swap space Minchan Kim

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