@@ -601,16 +601,16 @@ static void online_pages_range(unsigned long start_pfn, unsigned long nr_pages)
unsigned long pfn;
/*
- * Online the pages in MAX_ORDER - 1 aligned chunks. The callback might
- * decide to not expose all pages to the buddy (e.g., expose them
+ * Online the pages in PFN_SECTION_SHIFT aligned chunks. The callback
+ * might decide to not expose all pages to the buddy (e.g., expose them
* later). We account all pages as being online and belonging to this
* zone ("present").
* When using memmap_on_memory, the range might not be aligned to
- * MAX_ORDER_NR_PAGES - 1, but pageblock aligned. __ffs() will detect
- * this and the first chunk to online will be pageblock_nr_pages.
+ * PAGES_PER_SECTION - 1, but section size aligned. __ffs() will detect
+ * this and the first chunk to online will be PAGES_PER_SECTION.
*/
for (pfn = start_pfn; pfn < end_pfn;) {
- int order = min(MAX_ORDER - 1UL, __ffs(pfn));
+ int order = min_t(unsigned long, PFN_SECTION_SHIFT, __ffs(pfn));
(*online_page_callback)(pfn_to_page(pfn), order);
pfn += (1UL << order);