Skip to contentSkip to conversation

prevent to reclaim anon page of lumpy reclaim for no swap space

PATCH New Minchan Kim 1 participant 1 message Jun 27, 2009 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 prevent to reclaim anon page of lumpy reclaim for no swap space

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.

Cc Mel Gorman <[email protected]>
Cc KOSAKI Motohiro <[email protected]>
Cc Rik van Riel <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
vmscan.c renamed from vmscan.c.orig +6 -0
@@ -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;
 
Signature · 8 lines
Kinds Regards,
Minchan Kim 

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