[openeuler:OLK-6.6 3493/3493] mm/mempolicy.c:1115:25: warning: variable 'vma' set but not used
Hi Ze, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: d86ef4e1e96aa04c46e92dca30f98d069c1ad15a commit: dba69db9a5fc7c2c9c0cda0f32bb3b5f3d73ef93 [3493/3493] mm/damon/vaddr: Add demotion interface for migrating cold pages to target nodemask config: loongarch-randconfig-r111-20251209 (https://download.01.org/0day-ci/archive/20251209/202512091141.r06Y9a5w-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 6ec8c4351cfc1d0627d1633b02ea787bd29c77d8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251209/202512091141.r06Y9a5w-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/202512091141.r06Y9a5w-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from <built-in>:3: In file included from include/linux/compiler_types.h:150: include/linux/compiler-clang.h:33:9: warning: '__SANITIZE_ADDRESS__' macro redefined [-Wmacro-redefined] 33 | #define __SANITIZE_ADDRESS__ | ^ <built-in>:372:9: note: previous definition is here 372 | #define __SANITIZE_ADDRESS__ 1 | ^ In file included from mm/mempolicy.c:108: In file included from arch/loongarch/include/asm/tlb.h:140: include/asm-generic/tlb.h:632:10: warning: parameter 'ptep' set but not used [-Wunused-but-set-parameter] 632 | pte_t *ptep, unsigned int nr, unsigned long address) | ^ In file included from mm/mempolicy.c:108: arch/loongarch/include/asm/tlb.h:144:24: warning: default initialization of an object of type 'struct vm_area_struct' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe] 144 | struct vm_area_struct vma; | ^ include/linux/mm_types.h:659:20: note: member 'vm_flags' declared 'const' here 659 | const vm_flags_t vm_flags; | ^
mm/mempolicy.c:1115:25: warning: variable 'vma' set but not used [-Wunused-but-set-variable] 1115 | struct vm_area_struct *vma; | ^ mm/mempolicy.c:2951:25: warning: default initialization of an object of type 'struct vm_area_struct' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe] 2951 | struct vm_area_struct pvma; | ^ include/linux/mm_types.h:659:20: note: member 'vm_flags' declared 'const' here 659 | const vm_flags_t vm_flags; | ^ 5 warnings generated.
vim +/vma +1115 mm/mempolicy.c 1106 1107 /* 1108 * Migrate area pages from one node to a target node. 1109 * Returns error or the number of pages not migrated. 1110 */ 1111 static int migrate_area_to_node(struct mm_struct *mm, int source, int dest, 1112 unsigned long start, unsigned long end, int flags) 1113 { 1114 nodemask_t nmask;
1115 struct vm_area_struct *vma; 1116 LIST_HEAD(pagelist); 1117 int err = 0; 1118 struct migration_target_control mtc = { 1119 .nid = dest, 1120 .gfp_mask = GFP_HIGHUSER_MOVABLE | __GFP_THISNODE, 1121 }; 1122 1123 nodes_clear(nmask); 1124 node_set(source, nmask); 1125 1126 /* 1127 * This does not "check" the range but isolates all pages that 1128 * need migration. Between passing in the full user address 1129 * space range and MPOL_MF_DISCONTIG_OK, this call can not fail. 1130 */ 1131 vma = find_vma(mm, 0); 1132 VM_BUG_ON(!(flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))); 1133 queue_pages_range(mm, start, end, &nmask, 1134 flags | MPOL_MF_DISCONTIG_OK, &pagelist, false); 1135 1136 if (!list_empty(&pagelist)) { 1137 err = migrate_pages(&pagelist, alloc_migration_target, NULL, 1138 (unsigned long)&mtc, MIGRATE_SYNC, MR_DAMON_DEMOTION, NULL); 1139 if (err) 1140 putback_movable_pages(&pagelist); 1141 } 1142 1143 return err; 1144 } 1145
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot