lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sat, 27 Jun 2009 13:11:52 +0900
From:	Minchan Kim <minchan.kim@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Mel Gorman <mel@....ul.ie>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Rik van Riel <riel@...hat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	linux-mm <linux-mm@...ck.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH v2][mmotm-2009-0625-1549]  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.

Signed-off-by: Minchan Kim <minchan.kim@...il.com>
Cc: Mel Gorman <mel@....ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ