From: Vlastimil Babka <vbabka@suse.cz>
To: Joonsoo Kim <js1304@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
David Rientjes <rientjes@google.com>,
Minchan Kim <minchan@kernel.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH v2 8/9] mm/compaction: don't use higher order freepage than compaction aims at
Date: Fri, 25 Sep 2015 13:41:48 +0200 [thread overview]
Message-ID: <560532FC.5000800@suse.cz> (raw)
In-Reply-To: <1440382773-16070-9-git-send-email-iamjoonsoo.kim@lge.com>
On 08/24/2015 04:19 AM, Joonsoo Kim wrote:
> Purpose of compaction is to make high order page. To achive this purpose,
> it is the best strategy that compaction migrates contiguous used pages
> to fragmented unused freepages. Currently, freepage scanner don't
> distinguish whether freepage is fragmented or not and blindly use
> any freepage for migration target regardless of freepage's order.
>
> Using higher order freepage than compaction aims at is not good because
> what we do here is breaking high order freepage at somewhere and migrating
> used pages from elsewhere to this broken high order freepages in order to
> make new high order freepage. That is just position change of high order
> freepage.
>
> This is useless effort and doesn't help to make more high order freepages
> because we can't be sure that migrating used pages makes high order
> freepage. So, this patch makes freepage scanner only uses the ordered
> freepage lower than compaction order.
How often does this happen? If there's a free page of the order we need, then we
are done compacting anyway, no? Or is this happening because of the current
high-order watermark checking implementation? It would be interesting to measure
how often this skip would trigger. Also watermark checking should change with
Mel's patchset and then this patch shouldn't be needed?
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> ---
> mm/compaction.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index ca4d6d1..e61ee77 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -455,6 +455,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
> unsigned long flags = 0;
> bool locked = false;
> unsigned long blockpfn = *start_pfn;
> + unsigned long freepage_order;
>
> cursor = pfn_to_page(blockpfn);
>
> @@ -482,6 +483,20 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
> if (!PageBuddy(page))
> goto isolate_fail;
>
> + if (!strict && cc->order != -1) {
> + freepage_order = page_order_unsafe(page);
> +
> + if (freepage_order > 0 && freepage_order < MAX_ORDER) {
> + /*
> + * Do not use high order freepage for migration
> + * taret. It would not be beneficial for
> + * compaction success rate.
> + */
> + if (freepage_order >= cc->order)
It would be better to skip the whole freepage_order.
> + goto isolate_fail;
> + }
> + }
> +
> /*
> * If we already hold the lock, we can skip some rechecking.
> * Note that if we hold the lock now, checked_pageblock was
>
--
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>
next prev parent reply other threads:[~2015-09-25 11:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 2:19 [PATCH v2 0/9] mm/compaction: redesign compaction Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 1/9] mm/compaction: skip useless pfn when updating cached pfn Joonsoo Kim
2015-08-24 9:07 ` Vlastimil Babka
2015-09-07 5:35 ` Joonsoo Kim
2015-09-08 16:30 ` Vlastimil Babka
2015-08-24 2:19 ` [PATCH v2 2/9] mm/compaction: introduce compaction depleted state on zone Joonsoo Kim
2015-09-25 8:04 ` Vlastimil Babka
2015-09-30 8:12 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 3/9] mm/compaction: limit compaction activity in compaction depleted state Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 4/9] mm/compaction: remove compaction deferring Joonsoo Kim
2015-09-25 9:33 ` Vlastimil Babka
2015-09-30 8:28 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 5/9] mm/compaction: allow to scan nonmovable pageblock when depleted state Joonsoo Kim
2015-09-25 10:32 ` Vlastimil Babka
2015-09-30 8:30 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 6/9] mm/compaction: manage separate skip-bits for migration and free scanner Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 7/9] mm/compaction: redesign compaction Joonsoo Kim
2015-10-14 11:38 ` Vlastimil Babka
2015-10-15 2:38 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 8/9] mm/compaction: don't use higher order freepage than compaction aims at Joonsoo Kim
2015-09-25 11:41 ` Vlastimil Babka [this message]
2015-09-30 8:38 ` Joonsoo Kim
2015-08-24 2:19 ` [PATCH v2 9/9] mm/compaction: new threshold for compaction depleted zone Joonsoo Kim
2015-10-14 12:28 ` Vlastimil Babka
2015-10-15 6:03 ` Joonsoo Kim
2015-10-15 6:06 ` Joonsoo Kim
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=560532FC.5000800@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=js1304@gmail.com \
--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 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).