tree: https://github.com/ammarfaizi2/linux-block akpm/mm/mm-unstable head: a2765ca8c916591ebc9af48b4e545922c0bd3c3b commit: 95000286ff794d0195bb2ed4d3c7c92b5636caef [185/223] mm: switch vma_merge(), split_vma(), and __split_vma to vma iterator config: arm-randconfig-r046-20230106 compiler: arm-linux-gnueabi-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://github.com/ammarfaizi2/linux-block/commit/95000286ff794d0195bb2ed4d3c7c92b5636caef git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block akpm/mm/mm-unstable git checkout 95000286ff794d0195bb2ed4d3c7c92b5636caef # 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=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): >> mm/nommu.c:1337:5: error: conflicting types for 'split_vma'; have 'int(struct mm_struct *, struct vm_area_struct *, long unsigned int, int)' 1337 | int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, | ^~~~~~~~~ In file included from mm/nommu.c:20: include/linux/mm.h:2826:12: note: previous declaration of 'split_vma' with type 'int(struct vma_iterator *, struct vm_area_struct *, long unsigned int, int)' 2826 | extern int split_vma(struct vma_iterator *vmi, struct vm_area_struct *, | ^~~~~~~~~ vim +1337 mm/nommu.c a4679373cf4ee0 Christoph Hellwig 2010-03-10 1332 ^1da177e4c3f41 Linus Torvalds 2005-04-16 1333 /* 8feae13110d60c David Howells 2009-01-08 1334 * split a vma into two pieces at address 'addr', a new vma is allocated either 8feae13110d60c David Howells 2009-01-08 1335 * for the first part or the tail. ^1da177e4c3f41 Linus Torvalds 2005-04-16 1336 */ 8feae13110d60c David Howells 2009-01-08 @1337 int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, 8feae13110d60c David Howells 2009-01-08 1338 unsigned long addr, int new_below) ^1da177e4c3f41 Linus Torvalds 2005-04-16 1339 { 8feae13110d60c David Howells 2009-01-08 1340 struct vm_area_struct *new; 8feae13110d60c David Howells 2009-01-08 1341 struct vm_region *region; 8feae13110d60c David Howells 2009-01-08 1342 unsigned long npages; 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1343) MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_end); ^1da177e4c3f41 Linus Torvalds 2005-04-16 1344 779c10232ceb11 David Howells 2010-01-15 1345 /* we're only permitted to split anonymous regions (these should have 779c10232ceb11 David Howells 2010-01-15 1346 * only a single usage on the region) */ 779c10232ceb11 David Howells 2010-01-15 1347 if (vma->vm_file) 8feae13110d60c David Howells 2009-01-08 1348 return -ENOMEM; ^1da177e4c3f41 Linus Torvalds 2005-04-16 1349 8feae13110d60c David Howells 2009-01-08 1350 if (mm->map_count >= sysctl_max_map_count) 8feae13110d60c David Howells 2009-01-08 1351 return -ENOMEM; ^1da177e4c3f41 Linus Torvalds 2005-04-16 1352 8feae13110d60c David Howells 2009-01-08 1353 region = kmem_cache_alloc(vm_region_jar, GFP_KERNEL); 8feae13110d60c David Howells 2009-01-08 1354 if (!region) 8feae13110d60c David Howells 2009-01-08 1355 return -ENOMEM; 8feae13110d60c David Howells 2009-01-08 1356 3928d4f5ee37cd Linus Torvalds 2018-07-21 1357 new = vm_area_dup(vma); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1358) if (!new) 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1359) goto err_vma_dup; 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1360) 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1361) if (mas_preallocate(&mas, vma, GFP_KERNEL)) { 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1362) pr_warn("Allocation of vma tree for process %d failed\n", 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1363) current->pid); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1364) goto err_mas_preallocate; 925d1c401fa6cf Matt Helsley 2008-04-29 1365 } 8feae13110d60c David Howells 2009-01-08 1366 8feae13110d60c David Howells 2009-01-08 1367 /* most fields are the same, copy all, and then fixup */ 8feae13110d60c David Howells 2009-01-08 1368 *region = *vma->vm_region; 8feae13110d60c David Howells 2009-01-08 1369 new->vm_region = region; 8feae13110d60c David Howells 2009-01-08 1370 8feae13110d60c David Howells 2009-01-08 1371 npages = (addr - vma->vm_start) >> PAGE_SHIFT; 8feae13110d60c David Howells 2009-01-08 1372 8feae13110d60c David Howells 2009-01-08 1373 if (new_below) { dd8632a12e500a Paul Mundt 2009-01-08 1374 region->vm_top = region->vm_end = new->vm_end = addr; 8feae13110d60c David Howells 2009-01-08 1375 } else { 8feae13110d60c David Howells 2009-01-08 1376 region->vm_start = new->vm_start = addr; 8feae13110d60c David Howells 2009-01-08 1377 region->vm_pgoff = new->vm_pgoff += npages; ^1da177e4c3f41 Linus Torvalds 2005-04-16 1378 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 1379 8feae13110d60c David Howells 2009-01-08 1380 if (new->vm_ops && new->vm_ops->open) 8feae13110d60c David Howells 2009-01-08 1381 new->vm_ops->open(new); 8feae13110d60c David Howells 2009-01-08 1382 8feae13110d60c David Howells 2009-01-08 1383 down_write(&nommu_region_sem); 8feae13110d60c David Howells 2009-01-08 1384 delete_nommu_region(vma->vm_region); 8feae13110d60c David Howells 2009-01-08 1385 if (new_below) { 8feae13110d60c David Howells 2009-01-08 1386 vma->vm_region->vm_start = vma->vm_start = addr; 8feae13110d60c David Howells 2009-01-08 1387 vma->vm_region->vm_pgoff = vma->vm_pgoff += npages; 8feae13110d60c David Howells 2009-01-08 1388 } else { 8feae13110d60c David Howells 2009-01-08 1389 vma->vm_region->vm_end = vma->vm_end = addr; dd8632a12e500a Paul Mundt 2009-01-08 1390 vma->vm_region->vm_top = addr; ^1da177e4c3f41 Linus Torvalds 2005-04-16 1391 } 8feae13110d60c David Howells 2009-01-08 1392 add_nommu_region(vma->vm_region); 8feae13110d60c David Howells 2009-01-08 1393 add_nommu_region(new->vm_region); 8feae13110d60c David Howells 2009-01-08 1394 up_write(&nommu_region_sem); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1395) 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1396) setup_vma_to_mm(vma, mm); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1397) setup_vma_to_mm(new, mm); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1398) mas_set_range(&mas, vma->vm_start, vma->vm_end - 1); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1399) mas_store(&mas, vma); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1400) vma_mas_store(new, &mas); 8feae13110d60c David Howells 2009-01-08 1401 return 0; 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1402) 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1403) err_mas_preallocate: 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1404) vm_area_free(new); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1405) err_vma_dup: 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1406) kmem_cache_free(vm_region_jar, region); 8220543df1489e Matthew Wilcox (Oracle 2022-09-06 1407) return -ENOMEM; ^1da177e4c3f41 Linus Torvalds 2005-04-16 1408 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 1409 :::::: The code at line 1337 was first introduced by commit :::::: 8feae13110d60cc6287afabc2887366b0eb226c2 NOMMU: Make VMAs per MM as for MMU-mode linux :::::: TO: David Howells :::::: CC: David Howells -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests