From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx162.postini.com [74.125.245.162]) by kanga.kvack.org (Postfix) with SMTP id 9CD756B0031 for ; Wed, 4 Sep 2013 20:50:35 -0400 (EDT) Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Sep 2013 10:36:35 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 4642B2BB0052 for ; Thu, 5 Sep 2013 10:50:25 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r850Y9QX55115880 for ; Thu, 5 Sep 2013 10:34:10 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r850oNSj009840 for ; Thu, 5 Sep 2013 10:50:24 +1000 Date: Thu, 5 Sep 2013 08:50:22 +0800 From: Wanpeng Li Subject: Re: [patch] mm, compaction: periodically schedule when freeing pages Message-ID: <20130905005022.GA27516@hacker.(null)> Reply-To: Wanpeng Li References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Andrew Morton , Mel Gorman , Rik van Riel , Minchan Kim , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Wed, Sep 04, 2013 at 04:25:59PM -0700, David Rientjes wrote: >We've been getting warnings about an excessive amount of time spent >allocating pages for migration during memory compaction without >scheduling. isolate_freepages_block() already periodically checks for >contended locks or the need to schedule, but isolate_freepages() never >does. > >When a zone is massively long and no suitable targets can be found, this >iteration can be quite expensive without ever doing cond_resched(). > >Check periodically for the need to reschedule while the compaction free >scanner iterates. > Reviewed-by: Wanpeng Li >Signed-off-by: David Rientjes >--- > mm/compaction.c | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/mm/compaction.c b/mm/compaction.c >--- a/mm/compaction.c >+++ b/mm/compaction.c >@@ -677,6 +677,13 @@ static void isolate_freepages(struct zone *zone, > pfn -= pageblock_nr_pages) { > unsigned long isolated; > >+ /* >+ * This can iterate a massively long zone without finding any >+ * suitable migration targets, so periodically check if we need >+ * to schedule. >+ */ >+ cond_resched(); >+ > if (!pfn_valid(pfn)) > continue; > > >-- >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: email@kvack.org -- 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: email@kvack.org