From: Rik van Riel <riel@redhat.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
kamezawa.hiroyu@jp.fujitsu.com, minchan@kernel.org,
linux-kernel@vger.kernel.org, jaschut@sandia.gov
Subject: Re: [PATCH -mm] mm: have order>0 compaction start off where it left
Date: Thu, 28 Jun 2012 12:30:50 -0400 [thread overview]
Message-ID: <4FEC86BA.9050004@redhat.com> (raw)
In-Reply-To: <20120628102919.GQ8103@csn.ul.ie>
On 06/28/2012 06:29 AM, Mel Gorman wrote:
> Lets say there are two parallel compactions running. Process A meets
> the migration PFN and moves to the end of the zone to restart. Process B
> finishes scanning mid-way through the zone and updates last_free_pfn. This
> will cause Process A to "jump" to where Process B left off which is not
> necessarily desirable.
>
> Another side effect is that a workload that allocations/frees
> aggressively will not compact as well as the "free" scanner is not
> scanning the end of the zone each time. It would be better if
> last_free_pfn was updated when a full pageblock was encountered
>
> So;
>
> 1. Initialise last_free_pfn to the end of the zone
> 2. On compaction, scan from last_free_pfn and record where it started
> 3. If a pageblock is full, update last_free_pfn
> 4. If the migration and free scanner meet, reset last_free_pfn and
> the free scanner. Abort if the free scanner wraps to where it started
>
> Does that make sense?
Yes, that makes sense. We still have to keep track
of whether we have wrapped around, but I guess that
allows for a better name for the bool :)
Maybe cc->wrapped?
Does anyone have a better name?
As for point (4), should we abort when we wrap
around to where we started, or should we abort
when free_pfn and migrate_pfn meet after we
wrapped around?
>> diff --git a/mm/internal.h b/mm/internal.h
>> index 2ba87fb..b041874 100644
>> --- a/mm/internal.h
>> +++ b/mm/internal.h
>> @@ -120,6 +120,7 @@ struct compact_control {
>> unsigned long free_pfn; /* isolate_freepages search base */
>> unsigned long migrate_pfn; /* isolate_migratepages search base */
>> bool sync; /* Synchronous migration */
>> + bool last_round; /* Last round for order>0 compaction */
>>
>
> I don't get what you mean by last_round. Did you mean "wrapped". When
> false, it means the free scanner started from last_pfn and when true it
> means it started from last_pfn, met the migrate scanner and wrapped
> around to the end of the zone?
Yes, I do mean "wrapped" :)
--
All rights reversed
--
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:[~2012-06-28 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-28 3:37 [PATCH -mm] mm: have order>0 compaction start off where it left Rik van Riel
2012-06-28 10:29 ` Mel Gorman
2012-06-28 16:30 ` Rik van Riel [this message]
2012-06-29 2:58 ` Kamezawa Hiroyuki
2012-06-28 17:16 ` Jim Schutt
2012-06-28 17:25 ` Rik van Riel
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=4FEC86BA.9050004@redhat.com \
--to=riel@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=jaschut@sandia.gov \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--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 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).