aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9242d13f4ff3..20759803a64a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -783,6 +783,17 @@ static int move_freepages_block(struct zone *zone, struct page *page,
783 return move_freepages(zone, start_page, end_page, migratetype); 783 return move_freepages(zone, start_page, end_page, migratetype);
784} 784}
785 785
786static void change_pageblock_range(struct page *pageblock_page,
787 int start_order, int migratetype)
788{
789 int nr_pageblocks = 1 << (start_order - pageblock_order);
790
791 while (nr_pageblocks--) {
792 set_pageblock_migratetype(pageblock_page, migratetype);
793 pageblock_page += pageblock_nr_pages;
794 }
795}
796
786/* Remove an element from the buddy allocator from the fallback list */ 797/* Remove an element from the buddy allocator from the fallback list */
787static inline struct page * 798static inline struct page *
788__rmqueue_fallback(struct zone *zone, int order, int start_migratetype) 799__rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
@@ -836,8 +847,9 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
836 list_del(&page->lru); 847 list_del(&page->lru);
837 rmv_page_order(page); 848 rmv_page_order(page);
838 849
839 if (current_order == pageblock_order) 850 /* Take ownership for orders >= pageblock_order */
840 set_pageblock_migratetype(page, 851 if (current_order >= pageblock_order)
852 change_pageblock_range(page, current_order,
841 start_migratetype); 853 start_migratetype);
842 854
843 expand(zone, page, order, current_order, area, migratetype); 855 expand(zone, page, order, current_order, area, migratetype);