diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7c44b49cec40..8d52ab18fe0d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1123,10 +1123,19 @@ static void change_pageblock_range(struct page *pageblock_page, | |||
1123 | } | 1123 | } |
1124 | 1124 | ||
1125 | /* | 1125 | /* |
1126 | * If breaking a large block of pages, move all free pages to the preferred | 1126 | * When we are falling back to another migratetype during allocation, try to |
1127 | * allocation list. If falling back for a reclaimable kernel allocation, be | 1127 | * steal extra free pages from the same pageblocks to satisfy further |
1128 | * more aggressive about taking ownership of free pages. If we claim more than | 1128 | * allocations, instead of polluting multiple pageblocks. |
1129 | * half of the pageblock, change pageblock's migratetype as well. | 1129 | * |
1130 | * If we are stealing a relatively large buddy page, it is likely there will | ||
1131 | * be more free pages in the pageblock, so try to steal them all. For | ||
1132 | * reclaimable and unmovable allocations, we steal regardless of page size, | ||
1133 | * as fragmentation caused by those allocations polluting movable pageblocks | ||
1134 | * is worse than movable allocations stealing from unmovable and reclaimable | ||
1135 | * pageblocks. | ||
1136 | * | ||
1137 | * If we claim more than half of the pageblock, change pageblock's migratetype | ||
1138 | * as well. | ||
1130 | */ | 1139 | */ |
1131 | static void try_to_steal_freepages(struct zone *zone, struct page *page, | 1140 | static void try_to_steal_freepages(struct zone *zone, struct page *page, |
1132 | int start_type, int fallback_type) | 1141 | int start_type, int fallback_type) |
@@ -1141,6 +1150,7 @@ static void try_to_steal_freepages(struct zone *zone, struct page *page, | |||
1141 | 1150 | ||
1142 | if (current_order >= pageblock_order / 2 || | 1151 | if (current_order >= pageblock_order / 2 || |
1143 | start_type == MIGRATE_RECLAIMABLE || | 1152 | start_type == MIGRATE_RECLAIMABLE || |
1153 | start_type == MIGRATE_UNMOVABLE || | ||
1144 | page_group_by_mobility_disabled) { | 1154 | page_group_by_mobility_disabled) { |
1145 | int pages; | 1155 | int pages; |
1146 | 1156 | ||