All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanpeng Li <liwanp@linux.vnet.ibm.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>, Hillf Danton <dhillf@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: kswapd skips compaction if reclaim order drops to zero?
Date: Fri, 16 Aug 2013 08:25:22 +0800	[thread overview]
Message-ID: <20130816002522.GA13179@hacker.(null)> (raw)
In-Reply-To: <20130815141004.GD8437@gmail.com>

Hi Minchan,
On Thu, Aug 15, 2013 at 11:10:04PM +0900, Minchan Kim wrote:
>On Thu, Aug 15, 2013 at 02:56:27PM +0100, Mel Gorman wrote:
>> On Thu, Aug 15, 2013 at 10:41:39PM +0900, Minchan Kim wrote:
>> > Hey Mel,
>> > 
>> > On Thu, Aug 15, 2013 at 11:47:27AM +0100, Mel Gorman wrote:
>> > > On Thu, Aug 15, 2013 at 06:02:53PM +0800, Hillf Danton wrote:
>> > > > If the allocation order is not high, direct compaction does nothing.
>> > > > Can we skip compaction here if order drops to zero?
>> > > > 
>> > > 
>> > > If the allocation order is not high then
>> > > 
>> > > pgdat_needs_compaction == (order > 0) == false == no calling compact_pdatt
>> > > 
>> > > In the case where order is reset to 0 due to fragmentation then it does
>> > > call compact_pgdat but it does no work due to the cc->order check in
>> > > __compact_pgdat.
>> > > 
>> > 
>> > I am looking at mmotm-2013-08-07-16-55 but couldn't find cc->order
>> > check right before compact_zone in __comact_pgdat.
>> > Could you pinpoint code piece?
>> > 
>> 
>> Thanks, I screwed up as that check happens too late. However, it still
>> ends up not mattering because it does this
>> 
>> compact_pgdat
>>   -> __compact_pgdat
>>     -> compact_zone
>>       -> compaction_suitable
>> 
>> For order == 0, compaction_suitable will return either COMPACT_SKIPPED
>> (if the watermarks are not met) and COMPACT_PARTIAL otherwise. Either
>> way, compaction doesn't run.
>
>In compaction_suitable, it could pass first zone_watermark_ok
>but failed second zone_watermark_ok while fragindex is -1000
>so compaction could run.
>

I'm not sure why you said that second zone_watermark_ok failed while 
fragindex is -1000, actually they are the same check against order 0.

First:
watermark = low_wmark_pages(zone) + (2UL << order);
zone_watermark_ok(zone, 0, watermark, 0, 0);

Second:
fragindex == -1000 && zone_watermark_ok(zone, order, watermark, 0, 0)

Both COMPACT_SKIPPED and COMPACT_PARTIAL will fail compaction.

Regards,
Wanpeng Li 

>And we shouldn't depend on such coincidence.
>
>
>> 
>> -- 
>> Mel Gorman
>> SUSE Labs
>> 
>> --
>> 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>
>
>-- 
>Kind regards,
>Minchan Kim
>
>--
>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-08-16  0:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 10:02 kswapd skips compaction if reclaim order drops to zero? Hillf Danton
2013-08-15 10:02 ` Hillf Danton
2013-08-15 10:47 ` Mel Gorman
2013-08-15 10:47   ` Mel Gorman
2013-08-15 13:41   ` Minchan Kim
2013-08-15 13:41     ` Minchan Kim
2013-08-15 13:56     ` Mel Gorman
2013-08-15 13:56       ` Mel Gorman
2013-08-15 14:10       ` Minchan Kim
2013-08-15 14:10         ` Minchan Kim
2013-08-15 15:39         ` [PATCH] mm: compaction: Do not compact pgdat for order-0 Mel Gorman
2013-08-15 15:39           ` Mel Gorman
2013-08-16  4:37           ` Minchan Kim
2013-08-16  4:37             ` Minchan Kim
2013-08-16  0:25         ` Wanpeng Li [this message]
2013-08-16  0:25         ` kswapd skips compaction if reclaim order drops to zero? Wanpeng Li

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='20130816002522.GA13179@hacker.(null)' \
    --to=liwanp@linux.vnet.ibm.com \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    /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.