tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 552667f6edabe9e4bc2c86f990f53749bebfcbed commit: c7fcbe1041758d0dedc32502609a73a22884d7b8 [13795/13866] mm: shmem: Merge shmem_alloc_hugefolio() with shmem_alloc_folio() config: x86_64-randconfig-014-20240905 (https://download.01.org/0day-ci/archive/20240905/202409051939.TTEs2Xg7-lkp@i...) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240905/202409051939.TTEs2Xg7-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409051939.TTEs2Xg7-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/shmem.c:1660:6: warning: variable 'folio' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 1660 | if (!shmem_prepare_alloc(&gfp)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ mm/shmem.c:1688:7: note: uninitialized use occurs here 1688 | if (!folio) | ^~~~~ mm/shmem.c:1660:2: note: remove the 'if' if its condition is always false 1660 | if (!shmem_prepare_alloc(&gfp)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1661 | goto no_mem; | ~~~~~~~~~~~ mm/shmem.c:1653:21: note: initialize the variable 'folio' to silence this warning 1653 | struct folio *folio; | ^ | = NULL
mm/shmem.c:1641:57: error: call to '__compiletime_assert_745' declared with 'error' attribute: BUILD_BUG failed
1641 | folio = vma_alloc_folio(gfp, order, &pvma, 0, order == HPAGE_PMD_ORDER); | ^ include/linux/huge_mm.h:110:26: note: expanded from macro 'HPAGE_PMD_ORDER' 110 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ^ include/linux/huge_mm.h:106:28: note: expanded from macro 'HPAGE_PMD_SHIFT' 106 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:439:2: note: expanded from macro '_compiletime_assert' 439 | __compiletime_assert(condition, msg, prefix, suffix) | ^ include/linux/compiler_types.h:432:4: note: expanded from macro '__compiletime_assert' 432 | prefix ## suffix(); \ | ^ <scratch space>:61:1: note: expanded from here 61 | __compiletime_assert_745 | ^
mm/shmem.c:1641:57: error: call to '__compiletime_assert_745' declared with 'error' attribute: BUILD_BUG failed
include/linux/huge_mm.h:110:26: note: expanded from macro 'HPAGE_PMD_ORDER' 110 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ^ include/linux/huge_mm.h:106:28: note: expanded from macro 'HPAGE_PMD_SHIFT' 106 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:439:2: note: expanded from macro '_compiletime_assert' 439 | __compiletime_assert(condition, msg, prefix, suffix) | ^ include/linux/compiler_types.h:432:4: note: expanded from macro '__compiletime_assert' 432 | prefix ## suffix(); \ | ^ <scratch space>:61:1: note: expanded from here 61 | __compiletime_assert_745 | ^ 1 warning and 2 errors generated.
vim +1641 mm/shmem.c
1633 1634 static struct folio *shmem_alloc_folio(gfp_t gfp, int order, 1635 struct shmem_inode_info *info, pgoff_t index) 1636 { 1637 struct vm_area_struct pvma; 1638 struct folio *folio; 1639 1640 shmem_pseudo_vma_init(&pvma, info, index);
1641 folio = vma_alloc_folio(gfp, order, &pvma, 0, order == HPAGE_PMD_ORDER);
1642 shmem_pseudo_vma_destroy(&pvma); 1643 1644 return folio; 1645 } 1646