|
@@ -688,7 +688,6 @@ static void isolate_freepages(struct zone *zone,
|
|
unsigned long block_start_pfn; /* start of current pageblock */
|
|
unsigned long block_start_pfn; /* start of current pageblock */
|
|
unsigned long block_end_pfn; /* end of current pageblock */
|
|
unsigned long block_end_pfn; /* end of current pageblock */
|
|
unsigned long low_pfn; /* lowest pfn scanner is able to scan */
|
|
unsigned long low_pfn; /* lowest pfn scanner is able to scan */
|
|
- unsigned long next_free_pfn; /* start pfn for scaning at next round */
|
|
|
|
int nr_freepages = cc->nr_freepages;
|
|
int nr_freepages = cc->nr_freepages;
|
|
struct list_head *freelist = &cc->freepages;
|
|
struct list_head *freelist = &cc->freepages;
|
|
|
|
|
|
@@ -708,12 +707,6 @@ static void isolate_freepages(struct zone *zone,
|
|
zone_end_pfn(zone));
|
|
zone_end_pfn(zone));
|
|
low_pfn = ALIGN(cc->migrate_pfn + 1, pageblock_nr_pages);
|
|
low_pfn = ALIGN(cc->migrate_pfn + 1, pageblock_nr_pages);
|
|
|
|
|
|
- /*
|
|
|
|
- * If no pages are isolated, the block_start_pfn < low_pfn check
|
|
|
|
- * will kick in.
|
|
|
|
- */
|
|
|
|
- next_free_pfn = 0;
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Isolate free pages until enough are available to migrate the
|
|
* Isolate free pages until enough are available to migrate the
|
|
* pages on cc->migratepages. We stop searching if the migrate
|
|
* pages on cc->migratepages. We stop searching if the migrate
|
|
@@ -754,19 +747,19 @@ static void isolate_freepages(struct zone *zone,
|
|
continue;
|
|
continue;
|
|
|
|
|
|
/* Found a block suitable for isolating free pages from */
|
|
/* Found a block suitable for isolating free pages from */
|
|
|
|
+ cc->free_pfn = block_start_pfn;
|
|
isolated = isolate_freepages_block(cc, block_start_pfn,
|
|
isolated = isolate_freepages_block(cc, block_start_pfn,
|
|
block_end_pfn, freelist, false);
|
|
block_end_pfn, freelist, false);
|
|
nr_freepages += isolated;
|
|
nr_freepages += isolated;
|
|
|
|
|
|
/*
|
|
/*
|
|
- * Record the highest PFN we isolated pages from. When next
|
|
|
|
- * looking for free pages, the search will restart here as
|
|
|
|
- * page migration may have returned some pages to the allocator
|
|
|
|
|
|
+ * Set a flag that we successfully isolated in this pageblock.
|
|
|
|
+ * In the next loop iteration, zone->compact_cached_free_pfn
|
|
|
|
+ * will not be updated and thus it will effectively contain the
|
|
|
|
+ * highest pageblock we isolated pages from.
|
|
*/
|
|
*/
|
|
- if (isolated && next_free_pfn == 0) {
|
|
|
|
|
|
+ if (isolated)
|
|
cc->finished_update_free = true;
|
|
cc->finished_update_free = true;
|
|
- next_free_pfn = block_start_pfn;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/* split_free_page does not map the pages */
|
|
/* split_free_page does not map the pages */
|
|
@@ -777,9 +770,8 @@ static void isolate_freepages(struct zone *zone,
|
|
* so that compact_finished() may detect this
|
|
* so that compact_finished() may detect this
|
|
*/
|
|
*/
|
|
if (block_start_pfn < low_pfn)
|
|
if (block_start_pfn < low_pfn)
|
|
- next_free_pfn = cc->migrate_pfn;
|
|
|
|
|
|
+ cc->free_pfn = cc->migrate_pfn;
|
|
|
|
|
|
- cc->free_pfn = next_free_pfn;
|
|
|
|
cc->nr_freepages = nr_freepages;
|
|
cc->nr_freepages = nr_freepages;
|
|
}
|
|
}
|
|
|
|
|