Re: [PATCH v2 1/1] mm: initialize pages on demand during boot

From: kbuild test robot
Date: Sat Feb 10 2018 - 00:25:07 EST


Hi Pavel,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mmotm/master]
[also build test ERROR on next-20180209]
[cannot apply to v4.15]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Pavel-Tatashin/mm-initialize-pages-on-demand-during-boot/20180210-125104
base: git://git.cmpxchg.org/linux-mmotm.git master
config: x86_64-randconfig-x017-201805 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

mm/page_alloc.c: In function 'deferred_grow_zone':
>> mm/page_alloc.c:1590:18: error: 'struct zone' has no member named 'node'; did you mean 'name'?
int nid = zone->node;
^~~~
name

vim +1590 mm/page_alloc.c

1578
1579 /*
1580 * If this zone has deferred pages, try to grow it by initializing enough
1581 * deferred pages to satisfy the allocation specified by order, rounded up to
1582 * the nearest PAGES_PER_SECTION boundary. So we're adding memory in increments
1583 * of SECTION_SIZE bytes by initializing struct pages in increments of
1584 * PAGES_PER_SECTION * sizeof(struct page) bytes.
1585 */
1586 static noinline bool __init
1587 deferred_grow_zone(struct zone *zone, unsigned int order)
1588 {
1589 int zid = zone_idx(zone);
> 1590 int nid = zone->node;
1591 pg_data_t *pgdat = NODE_DATA(nid);
1592 unsigned long nr_pages_needed = ALIGN(1 << order, PAGES_PER_SECTION);
1593 unsigned long nr_pages = 0;
1594 unsigned long first_init_pfn, first_deferred_pfn, spfn, epfn, t;
1595 phys_addr_t spa, epa;
1596 u64 i;
1597
1598 /* Only the last zone may have deferred pages */
1599 if (zone_end_pfn(zone) != pgdat_end_pfn(pgdat))
1600 return false;
1601
1602 first_deferred_pfn = READ_ONCE(pgdat->first_deferred_pfn);
1603 first_init_pfn = max(zone->zone_start_pfn, first_deferred_pfn);
1604
1605 if (first_init_pfn >= pgdat_end_pfn(pgdat))
1606 return false;
1607
1608 spin_lock(&deferred_zone_grow_lock);
1609 /*
1610 * Bail if we raced with another thread that disabled on demand
1611 * initialization.
1612 */
1613 if (!static_branch_unlikely(&deferred_pages)) {
1614 spin_unlock(&deferred_zone_grow_lock);
1615 return false;
1616 }
1617
1618 for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
1619 spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
1620 epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
1621
1622 while (spfn < epfn && nr_pages < nr_pages_needed) {
1623 t = ALIGN(spfn + PAGES_PER_SECTION, PAGES_PER_SECTION);
1624 first_deferred_pfn = min(t, epfn);
1625 nr_pages += deferred_init_pages(nid, zid, spfn,
1626 first_deferred_pfn);
1627 spfn = first_deferred_pfn;
1628 }
1629
1630 if (nr_pages >= nr_pages_needed)
1631 break;
1632 }
1633
1634 for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
1635 spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
1636 epfn = min_t(unsigned long, first_deferred_pfn, PFN_DOWN(epa));
1637 deferred_free_pages(nid, zid, spfn, epfn);
1638
1639 if (first_deferred_pfn == epfn)
1640 break;
1641 }
1642 WRITE_ONCE(pgdat->first_deferred_pfn, first_deferred_pfn);
1643 spin_unlock(&deferred_zone_grow_lock);
1644
1645 return nr_pages >= nr_pages_needed;
1646 }
1647

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip