From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THCrZ-0005yh-C8 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THCrM-00089H-Fc for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:06:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38732 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THCrM-00088v-8j for qemu-devel@nongnu.org; Thu, 27 Sep 2012 08:06:28 -0400 Date: Thu, 27 Sep 2012 13:06:21 +0100 From: Mel Gorman Message-ID: <20120927120621.GB3429@suse.de> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> <1348224383-1499-9-git-send-email-mgorman@suse.de> <20120921143656.60a9a6cd.akpm@linux-foundation.org> <20120924093938.GZ11266@suse.de> <20120924142644.06c38b80.akpm@linux-foundation.org> <20120925091207.GD11266@suse.de> <20120925130352.0d60957a.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20120925130352.0d60957a.akpm@linux-foundation.org> Subject: [Qemu-devel] [PATCH] mm: compaction: cache if a pageblock was scanned and no pages were isolated -fix2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Morton Cc: Richard Davies , KVM , QEMU-devel , LKML , Linux-MM , Avi Kivity , Shaohua Li The clearing of PG_migrate_skip potentially takes a long time if the zone is massive. Be safe and check if it needs to reschedule. This is a fix for mm-compaction-cache-if-a-pageblock-was-scanned-and-no-pages-were-isolated.patch Signed-off-by: Mel Gorman --- mm/compaction.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/compaction.c b/mm/compaction.c index fb07abb..722d10f 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -85,6 +85,9 @@ static void reset_isolation_suitable(struct zone *zone) /* Walk the zone and mark every pageblock as suitable for isolation */ for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) { struct page *page; + + cond_resched(); + if (!pfn_valid(pfn)) continue;