lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/15] mm: compaction: introduce isolate_freepages_range()
On Mon, Jan 30, 2012 at 11:48:20AM +0000, Mel Gorman wrote:
> > + if (!zone)
> > + zone = page_zone(pfn_to_page(pfn));
> > + else if (zone != page_zone(pfn_to_page(pfn)))
> > + break;
> > +
>
> So what you are checking for here is if you straddle zones.
> You could just initialise zone outside of the for loop. You can
> then check outside the loop if end_pfn is in a different zone to
> start_pfn. If it is, either adjust end_pfn accordingly or bail the
> entire operation avoiding the need for release_freepages() later. This
> will be a little cheaper.
>

Whoops, silly me! You are watching for overlapping zones which can
happen in some rare configurations and for that checking page_zone()
like this is necessary. You can still initialise zone outside the loop
but the page_zone() check is still necessary.

My bad.

--
Mel Gorman
SUSE Labs


\
 
 \ /
  Last update: 2012-01-30 12:59    [W:0.185 / U:3.652 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site