All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanpeng Li <liwanp@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
	Minchan Kim <minchan@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, compaction: periodically schedule when freeing pages
Date: Thu, 5 Sep 2013 08:50:22 +0800	[thread overview]
Message-ID: <20130905005022.GA27516@hacker.(null)> (raw)
In-Reply-To: <alpine.DEB.2.02.1309041625060.29607@chino.kir.corp.google.com>

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 <liwanp@linux.vnet.ibm.com>

>Signed-off-by: David Rientjes <rientjes@google.com>
>---
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2013-09-05  0:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 23:25 [patch] mm, compaction: periodically schedule when freeing pages David Rientjes
2013-09-04 23:25 ` David Rientjes
2013-09-04 23:58 ` Rik van Riel
2013-09-04 23:58   ` Rik van Riel
2013-09-05  0:50 ` Wanpeng Li
2013-09-05  0:50 ` Wanpeng Li [this message]
2013-09-10 13:20 ` Mel Gorman
2013-09-10 13:20   ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20130905005022.GA27516@hacker.(null)' \
    --to=liwanp@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.