diff options
-rw-r--r-- | include/linux/page-isolation.h | 3 | ||||
-rw-r--r-- | mm/page_alloc.c | 14 | ||||
-rw-r--r-- | mm/page_isolation.c | 11 |
3 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h index fca8c0a5c188..76a9539cfd3f 100644 --- a/include/linux/page-isolation.h +++ b/include/linux/page-isolation.h | |||
@@ -41,6 +41,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); | |||
41 | */ | 41 | */ |
42 | int set_migratetype_isolate(struct page *page); | 42 | int set_migratetype_isolate(struct page *page); |
43 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); | 43 | void unset_migratetype_isolate(struct page *page, unsigned migratetype); |
44 | 44 | struct page *alloc_migrate_target(struct page *page, unsigned long private, | |
45 | int **resultp); | ||
45 | 46 | ||
46 | #endif | 47 | #endif |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b97cf12f07a9..8ac593893e6e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5667,18 +5667,6 @@ static unsigned long pfn_max_align_up(unsigned long pfn) | |||
5667 | pageblock_nr_pages)); | 5667 | pageblock_nr_pages)); |
5668 | } | 5668 | } |
5669 | 5669 | ||
5670 | static struct page * | ||
5671 | __alloc_contig_migrate_alloc(struct page *page, unsigned long private, | ||
5672 | int **resultp) | ||
5673 | { | ||
5674 | gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE; | ||
5675 | |||
5676 | if (PageHighMem(page)) | ||
5677 | gfp_mask |= __GFP_HIGHMEM; | ||
5678 | |||
5679 | return alloc_page(gfp_mask); | ||
5680 | } | ||
5681 | |||
5682 | /* [start, end) must belong to a single zone. */ | 5670 | /* [start, end) must belong to a single zone. */ |
5683 | static int __alloc_contig_migrate_range(struct compact_control *cc, | 5671 | static int __alloc_contig_migrate_range(struct compact_control *cc, |
5684 | unsigned long start, unsigned long end) | 5672 | unsigned long start, unsigned long end) |
@@ -5714,7 +5702,7 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, | |||
5714 | reclaim_clean_pages_from_list(cc->zone, &cc->migratepages); | 5702 | reclaim_clean_pages_from_list(cc->zone, &cc->migratepages); |
5715 | 5703 | ||
5716 | ret = migrate_pages(&cc->migratepages, | 5704 | ret = migrate_pages(&cc->migratepages, |
5717 | __alloc_contig_migrate_alloc, | 5705 | alloc_migrate_target, |
5718 | 0, false, MIGRATE_SYNC); | 5706 | 0, false, MIGRATE_SYNC); |
5719 | } | 5707 | } |
5720 | 5708 | ||
diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 5f34a9053ce0..f2f5b4818e94 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c | |||
@@ -255,3 +255,14 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn) | |||
255 | spin_unlock_irqrestore(&zone->lock, flags); | 255 | spin_unlock_irqrestore(&zone->lock, flags); |
256 | return ret ? 0 : -EBUSY; | 256 | return ret ? 0 : -EBUSY; |
257 | } | 257 | } |
258 | |||
259 | struct page *alloc_migrate_target(struct page *page, unsigned long private, | ||
260 | int **resultp) | ||
261 | { | ||
262 | gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE; | ||
263 | |||
264 | if (PageHighMem(page)) | ||
265 | gfp_mask |= __GFP_HIGHMEM; | ||
266 | |||
267 | return alloc_page(gfp_mask); | ||
268 | } | ||