linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmscam: check page order in isolating lru pages
@ 2011-12-29 12:45 Hillf Danton
  2011-12-29 17:35 ` KOSAKI Motohiro
  0 siblings, 1 reply; 6+ messages in thread
From: Hillf Danton @ 2011-12-29 12:45 UTC (permalink / raw)
  To: linux-mm
  Cc: David Rientjes, Hugh Dickins, Andrew Morton, KAMEZAWA Hiroyuki,
	Michal Hocko, LKML

Before we try to isolate physically contiguous pages, check for page order is
added, and if the reclaim order is no larger than page order, we should give up
the attempt.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
---

--- a/mm/vmscan.c	Thu Dec 29 20:20:16 2011
+++ b/mm/vmscan.c	Thu Dec 29 20:28:14 2011
@@ -1162,6 +1162,7 @@ static unsigned long isolate_lru_pages(u
 		unsigned long end_pfn;
 		unsigned long page_pfn;
 		int zone_id;
+		unsigned int isolated_pages = 0;

 		page = lru_to_page(src);
 		prefetchw_prev_lru_page(page, src, flags);
@@ -1172,7 +1173,7 @@ static unsigned long isolate_lru_pages(u
 		case 0:
 			mem_cgroup_lru_del(page);
 			list_move(&page->lru, dst);
-			nr_taken += hpage_nr_pages(page);
+			isolated_pages = hpage_nr_pages(page);
 			break;

 		case -EBUSY:
@@ -1184,8 +1185,11 @@ static unsigned long isolate_lru_pages(u
 			BUG();
 		}

+		nr_taken += isolated_pages;
 		if (!order)
 			continue;
+		if (isolated_pages != 1 && isolated_pages >= (1 << order))
+			continue;

 		/*
 		 * Attempt to take all pages in the order aligned region
@@ -1227,7 +1231,6 @@ static unsigned long isolate_lru_pages(u
 				break;

 			if (__isolate_lru_page(cursor_page, mode, file) == 0) {
-				unsigned int isolated_pages;

 				mem_cgroup_lru_del(cursor_page);
 				list_move(&cursor_page->lru, dst);

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-01-05 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 12:45 [PATCH] mm: vmscam: check page order in isolating lru pages Hillf Danton
2011-12-29 17:35 ` KOSAKI Motohiro
2011-12-31 14:55   ` Hillf Danton
2012-01-04  0:05     ` Andrew Morton
2012-01-05  6:20       ` KAMEZAWA Hiroyuki
2012-01-05 13:32     ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).