|
@@ -787,6 +787,15 @@ isolate_success:
|
|
cc->nr_migratepages++;
|
|
cc->nr_migratepages++;
|
|
nr_isolated++;
|
|
nr_isolated++;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Record where we could have freed pages by migration and not
|
|
|
|
+ * yet flushed them to buddy allocator.
|
|
|
|
+ * - this is the lowest page that was isolated and likely be
|
|
|
|
+ * then freed by migration.
|
|
|
|
+ */
|
|
|
|
+ if (!cc->last_migrated_pfn)
|
|
|
|
+ cc->last_migrated_pfn = low_pfn;
|
|
|
|
+
|
|
/* Avoid isolating too much */
|
|
/* Avoid isolating too much */
|
|
if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) {
|
|
if (cc->nr_migratepages == COMPACT_CLUSTER_MAX) {
|
|
++low_pfn;
|
|
++low_pfn;
|
|
@@ -1075,7 +1084,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
|
|
unsigned long block_start_pfn;
|
|
unsigned long block_start_pfn;
|
|
unsigned long block_end_pfn;
|
|
unsigned long block_end_pfn;
|
|
unsigned long low_pfn;
|
|
unsigned long low_pfn;
|
|
- unsigned long isolate_start_pfn;
|
|
|
|
struct page *page;
|
|
struct page *page;
|
|
const isolate_mode_t isolate_mode =
|
|
const isolate_mode_t isolate_mode =
|
|
(sysctl_compact_unevictable_allowed ? ISOLATE_UNEVICTABLE : 0) |
|
|
(sysctl_compact_unevictable_allowed ? ISOLATE_UNEVICTABLE : 0) |
|
|
@@ -1130,7 +1138,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
|
|
continue;
|
|
continue;
|
|
|
|
|
|
/* Perform the isolation */
|
|
/* Perform the isolation */
|
|
- isolate_start_pfn = low_pfn;
|
|
|
|
low_pfn = isolate_migratepages_block(cc, low_pfn,
|
|
low_pfn = isolate_migratepages_block(cc, low_pfn,
|
|
block_end_pfn, isolate_mode);
|
|
block_end_pfn, isolate_mode);
|
|
|
|
|
|
@@ -1139,15 +1146,6 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
|
|
return ISOLATE_ABORT;
|
|
return ISOLATE_ABORT;
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
- * Record where we could have freed pages by migration and not
|
|
|
|
- * yet flushed them to buddy allocator.
|
|
|
|
- * - this is the lowest page that could have been isolated and
|
|
|
|
- * then freed by migration.
|
|
|
|
- */
|
|
|
|
- if (cc->nr_migratepages && !cc->last_migrated_pfn)
|
|
|
|
- cc->last_migrated_pfn = isolate_start_pfn;
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Either we isolated something and proceed with migration. Or
|
|
* Either we isolated something and proceed with migration. Or
|
|
* we failed and compact_zone should decide if we should
|
|
* we failed and compact_zone should decide if we should
|