tree:
https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
meminit/descending-nodes/v1
head: 4360e9f3bf49a500417f73e62a133567fdf9842e
commit: b3e781793b0c9f7c2ae41a9fe3d6dac8a7e53e06 [2/3] dev: fix memmap init for descending
nodes
config: powerpc64-randconfig-r032-20210622 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
b259740801d3515810ecc15bf0c24b0d476a1608)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id...
git remote add rppt
https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
git fetch --no-tags rppt meminit/descending-nodes/v1
git checkout b3e781793b0c9f7c2ae41a9fe3d6dac8a7e53e06
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:44:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:48:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:52:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:56:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from mm/page_alloc.c:20:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:60:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
mm/page_alloc.c:3651:15: warning: no previous prototype for function
'should_fail_alloc_page' [-Wmissing-prototypes]
noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
mm/page_alloc.c:3651:10: note: declare 'static' if the function is not intended
to be used outside of this translation unit
noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
static
> mm/page_alloc.c:6511:2: error: void function
'init_unavailable_range' should not return a value [-Wreturn-type]
return 0;
^ ~
mm/page_alloc.c:6545:12: warning: variable 'zone_id' set but not used
[-Wunused-but-set-variable]
int i, j, zone_id, nid;
^
9 warnings and 1 error generated.
vim +/init_unavailable_range +6511 mm/page_alloc.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 6459
0740a50b9baa44 Mike Rapoport 2021-03-12 6460 #if !defined(CONFIG_FLAT_NODE_MEM_MAP)
0740a50b9baa44 Mike Rapoport 2021-03-12 6461 /*
0740a50b9baa44 Mike Rapoport 2021-03-12 6462 * Only struct pages that correspond to
ranges defined by memblock.memory
0740a50b9baa44 Mike Rapoport 2021-03-12 6463 * are zeroed and initialized by going
through __init_single_page() during
b3e781793b0c9f Mike Rapoport 2021-06-23 6464 * memmap_init_zone_range().
0740a50b9baa44 Mike Rapoport 2021-03-12 6465 *
0740a50b9baa44 Mike Rapoport 2021-03-12 6466 * But, there could be struct pages that
correspond to holes in
0740a50b9baa44 Mike Rapoport 2021-03-12 6467 * memblock.memory. This can happen
because of the following reasons:
0740a50b9baa44 Mike Rapoport 2021-03-12 6468 * - physical memory bank size is not
necessarily the exact multiple of the
0740a50b9baa44 Mike Rapoport 2021-03-12 6469 * arbitrary section size
0740a50b9baa44 Mike Rapoport 2021-03-12 6470 * - early reserved memory may not be
listed in memblock.memory
0740a50b9baa44 Mike Rapoport 2021-03-12 6471 * - memory layouts defined with memmap=
kernel parameter may not align
0740a50b9baa44 Mike Rapoport 2021-03-12 6472 * nicely with memmap sections
0740a50b9baa44 Mike Rapoport 2021-03-12 6473 *
0740a50b9baa44 Mike Rapoport 2021-03-12 6474 * Explicitly initialize those struct
pages so that:
0740a50b9baa44 Mike Rapoport 2021-03-12 6475 * - PG_Reserved is set
0740a50b9baa44 Mike Rapoport 2021-03-12 6476 * - zone and node links point to zone and
node that span the page if the
0740a50b9baa44 Mike Rapoport 2021-03-12 6477 * hole is in the middle of a zone
0740a50b9baa44 Mike Rapoport 2021-03-12 6478 * - zone and node links point to adjacent
zone/node if the hole falls on
0740a50b9baa44 Mike Rapoport 2021-03-12 6479 * the zone boundary; the pages in such
holes will be prepended to the
0740a50b9baa44 Mike Rapoport 2021-03-12 6480 * zone/node above the hole except for
the trailing pages in the last
0740a50b9baa44 Mike Rapoport 2021-03-12 6481 * section that will be appended to the
zone/node below.
0740a50b9baa44 Mike Rapoport 2021-03-12 6482 */
b3e781793b0c9f Mike Rapoport 2021-06-23 6483 static void __init
init_unavailable_range(unsigned long spfn,
0740a50b9baa44 Mike Rapoport 2021-03-12 6484 unsigned long epfn,
0740a50b9baa44 Mike Rapoport 2021-03-12 6485 int zone, int node)
0740a50b9baa44 Mike Rapoport 2021-03-12 6486 {
0740a50b9baa44 Mike Rapoport 2021-03-12 6487 unsigned long pfn;
0740a50b9baa44 Mike Rapoport 2021-03-12 6488 u64 pgcnt = 0;
0740a50b9baa44 Mike Rapoport 2021-03-12 6489
b3e781793b0c9f Mike Rapoport 2021-06-23 6490 pr_info("init_unavailable_range:
node: %d zone: %s: %lx - %lx\n", node, zone_names[zone], spfn, epfn);
b3e781793b0c9f Mike Rapoport 2021-06-23 6491
0740a50b9baa44 Mike Rapoport 2021-03-12 6492 for (pfn = spfn; pfn < epfn; pfn++) {
0740a50b9baa44 Mike Rapoport 2021-03-12 6493 if (!pfn_valid(ALIGN_DOWN(pfn,
pageblock_nr_pages))) {
0740a50b9baa44 Mike Rapoport 2021-03-12 6494 pfn = ALIGN_DOWN(pfn,
pageblock_nr_pages)
0740a50b9baa44 Mike Rapoport 2021-03-12 6495 + pageblock_nr_pages - 1;
0740a50b9baa44 Mike Rapoport 2021-03-12 6496 continue;
0740a50b9baa44 Mike Rapoport 2021-03-12 6497 }
0740a50b9baa44 Mike Rapoport 2021-03-12 6498 __init_single_page(pfn_to_page(pfn),
pfn, zone, node);
0740a50b9baa44 Mike Rapoport 2021-03-12 6499 __SetPageReserved(pfn_to_page(pfn));
0740a50b9baa44 Mike Rapoport 2021-03-12 6500 pgcnt++;
0740a50b9baa44 Mike Rapoport 2021-03-12 6501 }
0740a50b9baa44 Mike Rapoport 2021-03-12 6502
b3e781793b0c9f Mike Rapoport 2021-06-23 6503 pr_info("On node %d, zone %s: %lld
pages in unavailable ranges",
b3e781793b0c9f Mike Rapoport 2021-06-23 6504 node, zone_names[zone], pgcnt);
0740a50b9baa44 Mike Rapoport 2021-03-12 6505 }
0740a50b9baa44 Mike Rapoport 2021-03-12 6506 #else
b3e781793b0c9f Mike Rapoport 2021-06-23 6507 static inline void
init_unavailable_range(unsigned long spfn,
b3e781793b0c9f Mike Rapoport 2021-06-23 6508 unsigned long epfn,
0740a50b9baa44 Mike Rapoport 2021-03-12 6509 int zone, int node)
0740a50b9baa44 Mike Rapoport 2021-03-12 6510 {
0740a50b9baa44 Mike Rapoport 2021-03-12 @6511 return 0;
0740a50b9baa44 Mike Rapoport 2021-03-12 6512 }
0740a50b9baa44 Mike Rapoport 2021-03-12 6513 #endif
0740a50b9baa44 Mike Rapoport 2021-03-12 6514
:::::: The code at line 6511 was first introduced by commit
:::::: 0740a50b9baa4472cfb12442df4b39e2712a64a4 mm/page_alloc.c: refactor initialization
of struct page for holes in memory layout
:::::: TO: Mike Rapoport <rppt(a)linux.ibm.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org