On Sep 02 13:19, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: e47eb90a0a9ae20b82635b9b99a8d0979b757ad8 > commit: 2abbc27432878c26759d2913a22a7a15a66b96fd [4278/4736] mm/khugepaged: use minimal bits to store num page < HPAGE_PMD_NR > config: mips-randconfig-r013-20220901 (https://download.01.org/0day-ci/archive/20220902/202209021349.F73i5d6X-lkp@xxxxxxxxx/config) > compiler: mips-linux-gcc (GCC) 12.1.0 > 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 > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2abbc27432878c26759d2913a22a7a15a66b96fd > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 2abbc27432878c26759d2913a22a7a15a66b96fd > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > Reported-by: kernel test robot <lkp@xxxxxxxxx> > > All error/warnings (new ones prefixed by >>): > > In file included from include/linux/pgtable.h:6, > from include/linux/mm.h:29, > from mm/khugepaged.c:4: > >> arch/mips/include/asm/pgtable.h:238:26: warning: "__builtin_ffs" is not defined, evaluates to 0 [-Wundef] > 238 | #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) > | ^~~~~~~~~~~~~ > arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2' > 65 | # define PGDIR_SHIFT (2 * PAGE_SHIFT - PTE_T_LOG2 - 1) > | ^~~~~~~~~~ > include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT' > 11 | #define P4D_SHIFT PGDIR_SHIFT > | ^~~~~~~~~~~ > include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT' > 18 | #define PUD_SHIFT P4D_SHIFT > | ^~~~~~~~~ > include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT' > 20 | #define PMD_SHIFT PUD_SHIFT > | ^~~~~~~~~ > include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT' > 109 | #define HPAGE_PMD_SHIFT PMD_SHIFT > | ^~~~~~~~~ > include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT' > 105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) > | ^~~~~~~~~~~~~~~ > mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER' > 90 | #if HPAGE_PMD_ORDER < 16 > | ^~~~~~~~~~~~~~~ > >> arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "(" > 238 | #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) > | ^ > arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2' > 65 | # define PGDIR_SHIFT (2 * PAGE_SHIFT - PTE_T_LOG2 - 1) > | ^~~~~~~~~~ > include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT' > 11 | #define P4D_SHIFT PGDIR_SHIFT > | ^~~~~~~~~~~ > include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT' > 18 | #define PUD_SHIFT P4D_SHIFT > | ^~~~~~~~~ > include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT' > 20 | #define PMD_SHIFT PUD_SHIFT > | ^~~~~~~~~ > include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT' > 109 | #define HPAGE_PMD_SHIFT PMD_SHIFT > | ^~~~~~~~~ > include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT' > 105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) > | ^~~~~~~~~~~~~~~ > mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER' > 90 | #if HPAGE_PMD_ORDER < 16 > | ^~~~~~~~~~~~~~~ > > > vim +238 arch/mips/include/asm/pgtable.h > > ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16 235 > 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle 2007-08-01 236 #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) > 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle 2007-08-01 237 #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1) > 5ff974720abec2 include/asm-mips/pgtable.h Ralf Baechle 2007-08-01 @238 #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) > ^1da177e4c3f41 include/asm-mips/pgtable.h Linus Torvalds 2005-04-16 239 > > :::::: The code at line 238 was first introduced by commit > :::::: 5ff974720abec255c17af6f3732dd410d364e367 [MIPS] Fix computation of {PGD,PMD,PTE}_T_LOG2. > > :::::: TO: Ralf Baechle <ralf@xxxxxxxxxxxxxx> > :::::: CC: Ralf Baechle <ralf@xxxxxxxxxxxxxx> > > -- > 0-DAY CI Kernel Test Service > https://01.org/lkp > Sorry about this - have been trying to figure out what exactly is happening. AFAICT this config doesn't even build on v5.19 with the repro steps / compiler. ---8<--- ../arch/mips/mm/init.c:454:9: note: in expansion of macro 'BUILD_BUG_ON' 454 | BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT)); | ^~~~~~~~~~~~ ---8<--- Though if I set 64 bit kernel it builds 2abbc27432878c26759d2913a22a7a15a66b96fd fine - though I haven't gone through all levels of macros to see how that has changed the expansion of HPAGE_PMD_ORDER. Seems to be something specific to the "#if" directive as the compiler doesn't seem to complain about, for example, defining an int[HPAGE_PMD_ORDER] array in this struct. No fix yet, but just wanted to put this out there so it's known I'm looking into it. Thanks, Zach