|
@@ -2836,7 +2836,8 @@ static void setup_zone_migrate_reserve(struct zone *zone)
|
|
|
{
|
|
|
unsigned long start_pfn, pfn, end_pfn;
|
|
|
struct page *page;
|
|
|
- unsigned long reserve, block_migratetype;
|
|
|
+ unsigned long block_migratetype;
|
|
|
+ int reserve;
|
|
|
|
|
|
/* Get the start pfn, end pfn and the number of blocks to reserve */
|
|
|
start_pfn = zone->zone_start_pfn;
|
|
@@ -2844,6 +2845,15 @@ static void setup_zone_migrate_reserve(struct zone *zone)
|
|
|
reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >>
|
|
|
pageblock_order;
|
|
|
|
|
|
+ /*
|
|
|
+ * Reserve blocks are generally in place to help high-order atomic
|
|
|
+ * allocations that are short-lived. A min_free_kbytes value that
|
|
|
+ * would result in more than 2 reserve blocks for atomic allocations
|
|
|
+ * is assumed to be in place to help anti-fragmentation for the
|
|
|
+ * future allocation of hugepages at runtime.
|
|
|
+ */
|
|
|
+ reserve = min(2, reserve);
|
|
|
+
|
|
|
for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
|
|
|
if (!pfn_valid(pfn))
|
|
|
continue;
|