[linux-stable-rc:linux-4.19.y 8055/9999] mm/page_owner.c:276:10: note: in expansion of macro 'pfn_to_online_page'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
head:   312017a460d5ea31d646e7148e400e13db799ddc
commit: f712e3066f75996f49b60145f0329f9e078eeabd [8055/9999] mm/page_owner: don't access uninitialized memmaps when reading /proc/pagetypeinfo
config: ia64-randconfig-a001-20191213 (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f712e3066f75996f49b60145f0329f9e078eeabd
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/ptrace.h:46:0,
                    from arch/ia64/include/asm/processor.h:20,
                    from arch/ia64/include/asm/thread_info.h:12,
                    from include/linux/thread_info.h:38,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/ia64/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:81,
                    from include/linux/spinlock.h:51,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/debugfs.h:15,
                    from mm/page_owner.c:2:
   mm/internal.h: In function 'mem_map_next':
   arch/ia64/include/asm/page.h:118:36: error: 'max_mapnr' undeclared (first use in this function); did you mean 'dax_mapping'?
    # define pfn_valid(pfn)  (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
                                       ^
   mm/internal.h:385:8: note: in expansion of macro 'pfn_valid'
      if (!pfn_valid(pfn))
           ^~~~~~~~~
   arch/ia64/include/asm/page.h:118:36: note: each undeclared identifier is reported only once for each function it appears in
    # define pfn_valid(pfn)  (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
                                       ^
   mm/internal.h:385:8: note: in expansion of macro 'pfn_valid'
      if (!pfn_valid(pfn))
           ^~~~~~~~~
   mm/page_owner.c: In function 'pagetypeinfo_showmixedcount_print':
   arch/ia64/include/asm/page.h:118:36: error: 'max_mapnr' undeclared (first use in this function); did you mean 'dax_mapping'?
    # define pfn_valid(pfn)  (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
                                       ^
   include/linux/memory_hotplug.h:225:6: note: in expansion of macro 'pfn_valid'
     if (pfn_valid(pfn))   \
         ^~~~~~~~~
>> mm/page_owner.c:276:10: note: in expansion of macro 'pfn_to_online_page'
      page = pfn_to_online_page(pfn);
             ^~~~~~~~~~~~~~~~~~
   mm/page_owner.c: In function 'read_page_owner':
   arch/ia64/include/asm/page.h:118:36: error: 'max_mapnr' undeclared (first use in this function); did you mean 'dax_mapping'?
    # define pfn_valid(pfn)  (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
                                       ^
   mm/page_owner.c:470:10: note: in expansion of macro 'pfn_valid'
     while (!pfn_valid(pfn) && (pfn & (MAX_ORDER_NR_PAGES - 1)) != 0)
             ^~~~~~~~~
   mm/page_owner.c: In function 'init_pages_in_zone':
   arch/ia64/include/asm/page.h:118:36: error: 'max_mapnr' undeclared (first use in this function); did you mean 'dax_mapping'?
    # define pfn_valid(pfn)  (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
                                       ^
   mm/page_owner.c:544:8: note: in expansion of macro 'pfn_valid'
      if (!pfn_valid(pfn)) {
           ^~~~~~~~~

vim +/pfn_to_online_page +276 mm/page_owner.c

   254	
   255	void pagetypeinfo_showmixedcount_print(struct seq_file *m,
   256					       pg_data_t *pgdat, struct zone *zone)
   257	{
   258		struct page *page;
   259		struct page_ext *page_ext;
   260		struct page_owner *page_owner;
   261		unsigned long pfn = zone->zone_start_pfn, block_end_pfn;
   262		unsigned long end_pfn = pfn + zone->spanned_pages;
   263		unsigned long count[MIGRATE_TYPES] = { 0, };
   264		int pageblock_mt, page_mt;
   265		int i;
   266	
   267		/* Scan block by block. First and last block may be incomplete */
   268		pfn = zone->zone_start_pfn;
   269	
   270		/*
   271		 * Walk the zone in pageblock_nr_pages steps. If a page block spans
   272		 * a zone boundary, it will be double counted between zones. This does
   273		 * not matter as the mixed block count will still be correct
   274		 */
   275		for (; pfn < end_pfn; ) {
 > 276			page = pfn_to_online_page(pfn);
   277			if (!page) {
   278				pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES);
   279				continue;
   280			}
   281	
   282			block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages);
   283			block_end_pfn = min(block_end_pfn, end_pfn);
   284	
   285			pageblock_mt = get_pageblock_migratetype(page);
   286	
   287			for (; pfn < block_end_pfn; pfn++) {
   288				if (!pfn_valid_within(pfn))
   289					continue;
   290	
   291				/* The pageblock is online, no need to recheck. */
   292				page = pfn_to_page(pfn);
   293	
   294				if (page_zone(page) != zone)
   295					continue;
   296	
   297				if (PageBuddy(page)) {
   298					unsigned long freepage_order;
   299	
   300					freepage_order = page_order_unsafe(page);
   301					if (freepage_order < MAX_ORDER)
   302						pfn += (1UL << freepage_order) - 1;
   303					continue;
   304				}
   305	
   306				if (PageReserved(page))
   307					continue;
   308	
   309				page_ext = lookup_page_ext(page);
   310				if (unlikely(!page_ext))
   311					continue;
   312	
   313				if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags))
   314					continue;
   315	
   316				page_owner = get_page_owner(page_ext);
   317				page_mt = gfpflags_to_migratetype(
   318						page_owner->gfp_mask);
   319				if (pageblock_mt != page_mt) {
   320					if (is_migrate_cma(pageblock_mt))
   321						count[MIGRATE_MOVABLE]++;
   322					else
   323						count[pageblock_mt]++;
   324	
   325					pfn = block_end_pfn;
   326					break;
   327				}
   328				pfn += (1UL << page_owner->order) - 1;
   329			}
   330		}
   331	
   332		/* Print counts */
   333		seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
   334		for (i = 0; i < MIGRATE_TYPES; i++)
   335			seq_printf(m, "%12lu ", count[i]);
   336		seq_putc(m, '\n');
   337	}
   338	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux