linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: Huang Shijie <b32955@freescale.com>
Cc: akpm@linux-foundation.org, mgorman@suse.de, linux-mm@kvack.org,
	shijie8@gmail.com
Subject: Re: [PATCH v2] mm/compaction : check the watermark when cc->order is -1
Date: Thu, 12 Jan 2012 13:59:26 +0800	[thread overview]
Message-ID: <4F0E76BE.1070806@freescale.com> (raw)
In-Reply-To: <1325818201-1865-1-git-send-email-b32955@freescale.com>

于 2012年01月06日 10:50, Huang Shijie 写道:
> We get cc->order is -1 when user echos to /proc/sys/vm/compact_memory.
> In this case, we should check that if we have enough pages for
> the compaction in the zone.
>
> If we do not check this, in our MX6Q board(arm), i ever observed
> COMPACT_CLUSTER_MAX pages were compaction failed in per migrate_pages().
> Thats mean we can not alloc any pages by the free scanner in the zone.
>
> This patch checks the watermark to avoid this problem.
> Tested this patch in the MX6Q board.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  mm/compaction.c |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 899d956..bf8e8b2 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -479,21 +479,21 @@ unsigned long compaction_suitable(struct zone *zone, int order)
>  	unsigned long watermark;
>  
>  	/*
> +	 * Watermarks for order-0 must be met for compaction.
> +	 * During the migration, copies of pages need to be
> +	 * allocated and for a short time, so the footprint is higher.
>  	 * order == -1 is expected when compacting via
> -	 * /proc/sys/vm/compact_memory
> +	 * /proc/sys/vm/compact_memory.
>  	 */
> -	if (order == -1)
> -		return COMPACT_CONTINUE;
> +	watermark = low_wmark_pages(zone) +
> +		((order == -1) ? (COMPACT_CLUSTER_MAX * 2) : (2UL << order));
>  
> -	/*
> -	 * Watermarks for order-0 must be met for compaction. Note the 2UL.
> -	 * This is because during migration, copies of pages need to be
> -	 * allocated and for a short time, the footprint is higher
> -	 */
> -	watermark = low_wmark_pages(zone) + (2UL << order);
>  	if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
>  		return COMPACT_SKIPPED;
>  
> +	if (order == -1)
> +		return COMPACT_CONTINUE;
> +
>  	/*
>  	 * fragmentation index determines if allocation failures are due to
>  	 * low memory or external fragmentation
Is this patch meaningless?
I really think this patch is useful when the zone is nearly full.

Best Regards

Huang Shijie

--
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>

  reply	other threads:[~2012-01-12  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06  2:50 [PATCH v2] mm/compaction : check the watermark when cc->order is -1 Huang Shijie
2012-01-12  5:59 ` Huang Shijie [this message]
2012-01-12 12:05   ` Mel Gorman
2012-01-13  2:31     ` Huang Shijie
2012-01-13 11:28       ` Mel Gorman
2012-01-14  2:10         ` Huang Shijie
2012-01-12  8:15 ` Minchan Kim
2012-01-12  8:31   ` Huang Shijie

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=4F0E76BE.1070806@freescale.com \
    --to=b32955@freescale.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=shijie8@gmail.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 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).