Re: [PATCH 6/6] mm: have order > 0 compaction start near a pageblockwith free pages

From: Mel Gorman
Date: Wed Aug 08 2012 - 06:18:39 EST


On Wed, Aug 08, 2012 at 01:36:00PM +0900, Minchan Kim wrote:
> >
> > Second, it updates compact_cached_free_pfn in a more limited set of
> > circumstances.
> >
> > If a scanner has wrapped, it updates compact_cached_free_pfn to the end
> > of the zone. Each time a wrapped scanner isoaltes a page, it
> > updates compact_cached_free_pfn. The intention is that after
> > wrapping, the compact_cached_free_pfn will be at the highest
> > pageblock with free pages when compaction completes.
>
> Okay.
>
> >
> > If a scanner has not wrapped when compaction completes and
>
> Compaction complete?
> Your code seem to do it in isolate_freepages.
> Isn't it compaction complete?
>

s/compaction/free page isolation/

> > compact_cached_free_pfn is set the end of the the zone, initialise
> > it once.
>

> I can't understad this part.
> Could you elaborate a bit more?
>

Is this better?

If a scanner has wrapped, it updates compact_cached_free_pfn to the end
of the zone. When a wrapped scanner isolates a page, it updates
compact_cached_free_pfn to point to the highest pageblock it
can isolate pages from.

If a scanner has not wrapped when it has finished isolated pages it
checks if compact_cached_free_pfn is pointing to the end of the
zone. If so, the value is updated to point to the highest
pageblock that pages were isolated from. This value will not
be updated again until a free page scanner wraps and resets
compact_cached_free_pfn.

This is not optimal and it can still race but the compact_cached_free_pfn
will be pointing to or very near a pageblock with free pages.

--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/