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.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4c847cc57caf..33b1a4762a7b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2836,7 +2836,8 @@ static void setup_zone_migrate_reserve(struct zone *zone)
2836{ 2836{
2837 unsigned long start_pfn, pfn, end_pfn; 2837 unsigned long start_pfn, pfn, end_pfn;
2838 struct page *page; 2838 struct page *page;
2839 unsigned long reserve, block_migratetype; 2839 unsigned long block_migratetype;
2840 int reserve;
2840 2841
2841 /* Get the start pfn, end pfn and the number of blocks to reserve */ 2842 /* Get the start pfn, end pfn and the number of blocks to reserve */
2842 start_pfn = zone->zone_start_pfn; 2843 start_pfn = zone->zone_start_pfn;
@@ -2844,6 +2845,15 @@ static void setup_zone_migrate_reserve(struct zone *zone)
2844 reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >> 2845 reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >>
2845 pageblock_order; 2846 pageblock_order;
2846 2847
2848 /*
2849 * Reserve blocks are generally in place to help high-order atomic
2850 * allocations that are short-lived. A min_free_kbytes value that
2851 * would result in more than 2 reserve blocks for atomic allocations
2852 * is assumed to be in place to help anti-fragmentation for the
2853 * future allocation of hugepages at runtime.
2854 */
2855 reserve = min(2, reserve);
2856
2847 for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) { 2857 for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
2848 if (!pfn_valid(pfn)) 2858 if (!pfn_valid(pfn))
2849 continue; 2859 continue;