CC: [email protected] TO: [email protected] tree: https://android.googlesource.com/kernel/common android12-5.10 head: 7a069c607128b5634c5dfd290ed6b581a6a4a89c commit: dcceb19998c37648fa9300d0c81bd16daf840c9d [4173/13778] UPSTREAM: mm: speedup mremap on 1GB or larger regions :::::: branch date: 2 days ago :::::: commit date: 10 months ago config: arm-randconfig-c002-20211116 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a) 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 arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi git remote add android-common https://android.googlesource.com/kernel/common git fetch --no-tags android-common android12-5.10 git checkout dcceb19998c37648fa9300d0c81bd16daf840c9d # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/r100.c:2175:4: note: Taking false branch if (track->textures[u].use_pitch) { ^ drivers/gpu/drm/radeon/r100.c:2182:9: note: Assuming field 'family' is < CHIP_RV515 if (rdev->family >= CHIP_RV515) ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/r100.c:2182:5: note: Taking false branch if (rdev->family >= CHIP_RV515) ^ drivers/gpu/drm/radeon/r100.c:2185:9: note: Assuming field 'roundup_w' is true if (track->textures[u].roundup_w) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/radeon/r100.c:2185:5: note: Taking true branch if (track->textures[u].roundup_w) ^ drivers/gpu/drm/radeon/r100.c:2186:10: note: '?' condition is false w = roundup_pow_of_two(w); ^ include/linux/log2.h:175:2: note: expanded from macro 'roundup_pow_of_two' __builtin_constant_p(n) ? ( \ ^ drivers/gpu/drm/radeon/r100.c:2186:10: note: Calling '__roundup_pow_of_two' w = roundup_pow_of_two(w); ^ include/linux/log2.h:179:2: note: expanded from macro 'roundup_pow_of_two' __roundup_pow_of_two(n) \ ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/log2.h:57:16: note: Calling 'fls_long' return 1UL << fls_long(n - 1); ^~~~~~~~~~~~~~~ include/linux/bitops.h:184:2: note: Taking true branch if (sizeof(l) == 4) ^ include/linux/bitops.h:185:10: note: Calling 'fls' return fls(l); ^~~~~~ include/asm-generic/bitops/fls.h:15:2: note: 'r' initialized to 32 int r = 32; ^~~~~ include/asm-generic/bitops/fls.h:17:6: note: Assuming 'x' is not equal to 0, which participates in a condition later if (!x) ^~ include/asm-generic/bitops/fls.h:17:2: note: Taking false branch if (!x) ^ include/asm-generic/bitops/fls.h:19:6: note: Assuming the condition is false if (!(x & 0xffff0000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:19:2: note: Taking false branch if (!(x & 0xffff0000u)) { ^ include/asm-generic/bitops/fls.h:23:6: note: Assuming the condition is false if (!(x & 0xff000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:23:2: note: Taking false branch if (!(x & 0xff000000u)) { ^ include/asm-generic/bitops/fls.h:27:6: note: Assuming the condition is false if (!(x & 0xf0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:27:2: note: Taking false branch if (!(x & 0xf0000000u)) { ^ include/asm-generic/bitops/fls.h:31:6: note: Assuming the condition is false if (!(x & 0xc0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:31:2: note: Taking false branch if (!(x & 0xc0000000u)) { ^ include/asm-generic/bitops/fls.h:35:6: note: Assuming the condition is false if (!(x & 0x80000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:35:2: note: Taking false branch if (!(x & 0x80000000u)) { ^ include/asm-generic/bitops/fls.h:39:2: note: Returning the value 32 (loaded from 'r') return r; ^~~~~~~~ include/linux/bitops.h:185:10: note: Returning from 'fls' return fls(l); ^~~~~~ include/linux/bitops.h:185:3: note: Returning the value 32 return fls(l); ^~~~~~~~~~~~~ include/linux/log2.h:57:16: note: Returning from 'fls_long' return 1UL << fls_long(n - 1); ^~~~~~~~~~~~~~~ include/linux/log2.h:57:13: note: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' return 1UL << fls_long(n - 1); ^ ~~~~~~~~~~~~~~~ Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 10 warnings generated. >> mm/mremap.c:429:3: warning: Value stored to 'extent' is never read >> [clang-analyzer-deadcode.DeadStores] extent = get_extent(NORMAL_PUD, old_addr, old_end, new_addr); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/mremap.c:429:3: note: Value stored to 'extent' is never read extent = get_extent(NORMAL_PUD, old_addr, old_end, new_addr); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 10 warnings generated. Suppressed 10 warnings (8 in non-user code, 2 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 8 warnings generated. Suppressed 8 warnings (8 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 20 warnings generated. include/linux/log2.h:57:13: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult] return 1UL << fls_long(n - 1); ^ mm/page_alloc.c:8249:6: note: Assuming 'numentries' is not equal to 0 if (!numentries) { ^~~~~~~~~~~ mm/page_alloc.c:8249:2: note: Taking false branch if (!numentries) { ^ mm/page_alloc.c:8285:15: note: '?' condition is false numentries = roundup_pow_of_two(numentries); ^ include/linux/log2.h:175:2: note: expanded from macro 'roundup_pow_of_two' __builtin_constant_p(n) ? ( \ ^ mm/page_alloc.c:8285:15: note: Calling '__roundup_pow_of_two' numentries = roundup_pow_of_two(numentries); ^ include/linux/log2.h:179:2: note: expanded from macro 'roundup_pow_of_two' __roundup_pow_of_two(n) \ ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/log2.h:57:16: note: Calling 'fls_long' return 1UL << fls_long(n - 1); ^~~~~~~~~~~~~~~ include/linux/bitops.h:184:2: note: Taking true branch if (sizeof(l) == 4) ^ include/linux/bitops.h:185:10: note: Calling 'fls' return fls(l); ^~~~~~ include/asm-generic/bitops/fls.h:15:2: note: 'r' initialized to 32 int r = 32; ^~~~~ include/asm-generic/bitops/fls.h:17:6: note: Assuming 'x' is not equal to 0, which participates in a condition later if (!x) ^~ include/asm-generic/bitops/fls.h:17:2: note: Taking false branch if (!x) ^ include/asm-generic/bitops/fls.h:19:6: note: Assuming the condition is false if (!(x & 0xffff0000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:19:2: note: Taking false branch if (!(x & 0xffff0000u)) { ^ include/asm-generic/bitops/fls.h:23:6: note: Assuming the condition is false if (!(x & 0xff000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:23:2: note: Taking false branch if (!(x & 0xff000000u)) { ^ include/asm-generic/bitops/fls.h:27:6: note: Assuming the condition is false if (!(x & 0xf0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:27:2: note: Taking false branch if (!(x & 0xf0000000u)) { ^ include/asm-generic/bitops/fls.h:31:6: note: Assuming the condition is false if (!(x & 0xc0000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:31:2: note: Taking false branch if (!(x & 0xc0000000u)) { ^ include/asm-generic/bitops/fls.h:35:6: note: Assuming the condition is false if (!(x & 0x80000000u)) { ^~~~~~~~~~~~~~~~~~ include/asm-generic/bitops/fls.h:35:2: note: Taking false branch if (!(x & 0x80000000u)) { ^ include/asm-generic/bitops/fls.h:39:2: note: Returning the value 32 (loaded from 'r') return r; vim +/extent +429 mm/mremap.c dcceb19998c376 Kalesh Singh 2020-12-14 406 b6a2fea39318e4 Ollie Wild 2007-07-19 407 unsigned long move_page_tables(struct vm_area_struct *vma, ^1da177e4c3f41 Linus Torvalds 2005-04-16 408 unsigned long old_addr, struct vm_area_struct *new_vma, 38a76013ad809b Michel Lespinasse 2012-10-08 409 unsigned long new_addr, unsigned long len, 38a76013ad809b Michel Lespinasse 2012-10-08 410 bool need_rmap_locks) ^1da177e4c3f41 Linus Torvalds 2005-04-16 411 { dcceb19998c376 Kalesh Singh 2020-12-14 412 unsigned long extent, old_end; ac46d4f3c43241 Jérôme Glisse 2018-12-28 413 struct mmu_notifier_range range; 7be7a546994f12 Hugh Dickins 2005-10-29 414 pmd_t *old_pmd, *new_pmd; ^1da177e4c3f41 Linus Torvalds 2005-04-16 415 7be7a546994f12 Hugh Dickins 2005-10-29 416 old_end = old_addr + len; 7be7a546994f12 Hugh Dickins 2005-10-29 417 flush_cache_range(vma, old_addr, old_end); ^1da177e4c3f41 Linus Torvalds 2005-04-16 418 6f4f13e8d9e27c Jérôme Glisse 2019-05-13 419 mmu_notifier_range_init(&range, MMU_NOTIFY_UNMAP, 0, vma, vma->vm_mm, 6f4f13e8d9e27c Jérôme Glisse 2019-05-13 420 old_addr, old_end); ac46d4f3c43241 Jérôme Glisse 2018-12-28 421 mmu_notifier_invalidate_range_start(&range); 7b6efc2bc4f199 Andrea Arcangeli 2011-10-31 422 7be7a546994f12 Hugh Dickins 2005-10-29 423 for (; old_addr < old_end; old_addr += extent, new_addr += extent) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 424 cond_resched(); dcceb19998c376 Kalesh Singh 2020-12-14 425 /* dcceb19998c376 Kalesh Singh 2020-12-14 426 * If extent is PUD-sized try to speed up the move by moving at the dcceb19998c376 Kalesh Singh 2020-12-14 427 * PUD level if possible. dcceb19998c376 Kalesh Singh 2020-12-14 428 */ dcceb19998c376 Kalesh Singh 2020-12-14 @429 extent = get_extent(NORMAL_PUD, old_addr, old_end, new_addr); dcceb19998c376 Kalesh Singh 2020-12-14 430 if (IS_ENABLED(CONFIG_HAVE_MOVE_PUD) && extent == PUD_SIZE) { dcceb19998c376 Kalesh Singh 2020-12-14 431 pud_t *old_pud, *new_pud; dcceb19998c376 Kalesh Singh 2020-12-14 432 dcceb19998c376 Kalesh Singh 2020-12-14 433 old_pud = get_old_pud(vma->vm_mm, old_addr); dcceb19998c376 Kalesh Singh 2020-12-14 434 if (!old_pud) dcceb19998c376 Kalesh Singh 2020-12-14 435 continue; dcceb19998c376 Kalesh Singh 2020-12-14 436 new_pud = alloc_new_pud(vma->vm_mm, vma, new_addr); dcceb19998c376 Kalesh Singh 2020-12-14 437 if (!new_pud) dcceb19998c376 Kalesh Singh 2020-12-14 438 break; dcceb19998c376 Kalesh Singh 2020-12-14 439 if (move_pgt_entry(NORMAL_PUD, vma, old_addr, new_addr, dcceb19998c376 Kalesh Singh 2020-12-14 440 old_pud, new_pud, need_rmap_locks)) dcceb19998c376 Kalesh Singh 2020-12-14 441 continue; dcceb19998c376 Kalesh Singh 2020-12-14 442 } dcceb19998c376 Kalesh Singh 2020-12-14 443 dcceb19998c376 Kalesh Singh 2020-12-14 444 extent = get_extent(NORMAL_PMD, old_addr, old_end, new_addr); 7be7a546994f12 Hugh Dickins 2005-10-29 445 old_pmd = get_old_pmd(vma->vm_mm, old_addr); 7be7a546994f12 Hugh Dickins 2005-10-29 446 if (!old_pmd) 7be7a546994f12 Hugh Dickins 2005-10-29 447 continue; 8ac1f8320a0073 Andrea Arcangeli 2011-01-13 448 new_pmd = alloc_new_pmd(vma->vm_mm, vma, new_addr); 7be7a546994f12 Hugh Dickins 2005-10-29 449 if (!new_pmd) 7be7a546994f12 Hugh Dickins 2005-10-29 450 break; dcceb19998c376 Kalesh Singh 2020-12-14 451 if (is_swap_pmd(*old_pmd) || pmd_trans_huge(*old_pmd) || dcceb19998c376 Kalesh Singh 2020-12-14 452 pmd_devmap(*old_pmd)) { dcceb19998c376 Kalesh Singh 2020-12-14 453 if (extent == HPAGE_PMD_SIZE && dcceb19998c376 Kalesh Singh 2020-12-14 454 move_pgt_entry(HPAGE_PMD, vma, old_addr, new_addr, dcceb19998c376 Kalesh Singh 2020-12-14 455 old_pmd, new_pmd, need_rmap_locks)) 37a1c49a91ad55 Andrea Arcangeli 2011-10-31 456 continue; 4b471e8898c3d0 Kirill A. Shutemov 2016-01-15 457 split_huge_pmd(vma, old_pmd, old_addr); 337d9abf1cd1a5 Naoya Horiguchi 2016-07-26 458 if (pmd_trans_unstable(old_pmd)) 6b9116a652bd9e Kirill A. Shutemov 2016-02-11 459 continue; dcceb19998c376 Kalesh Singh 2020-12-14 460 } else if (IS_ENABLED(CONFIG_HAVE_MOVE_PMD) && dcceb19998c376 Kalesh Singh 2020-12-14 461 extent == PMD_SIZE) { 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 462) /* 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 463) * If the extent is PMD-sized, try to speed the move by 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 464) * moving at the PMD level if possible. 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 465) */ dcceb19998c376 Kalesh Singh 2020-12-14 466 if (move_pgt_entry(NORMAL_PMD, vma, old_addr, new_addr, dcceb19998c376 Kalesh Singh 2020-12-14 467 old_pmd, new_pmd, need_rmap_locks)) 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 468) continue; 37a1c49a91ad55 Andrea Arcangeli 2011-10-31 469 } 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 470) 4cf58924951ef8 Joel Fernandes (Google 2019-01-03 471) if (pte_alloc(new_vma->vm_mm, new_pmd)) 37a1c49a91ad55 Andrea Arcangeli 2011-10-31 472 break; 5d1904204c9959 Aaron Lu 2016-11-10 473 move_ptes(vma, old_pmd, old_addr, old_addr + extent, new_vma, eb66ae03082960 Linus Torvalds 2018-10-12 474 new_pmd, new_addr, need_rmap_locks); ^1da177e4c3f41 Linus Torvalds 2005-04-16 475 } 7b6efc2bc4f199 Andrea Arcangeli 2011-10-31 476 ac46d4f3c43241 Jérôme Glisse 2018-12-28 477 mmu_notifier_invalidate_range_end(&range); 7be7a546994f12 Hugh Dickins 2005-10-29 478 7be7a546994f12 Hugh Dickins 2005-10-29 479 return len + old_addr - old_end; /* how much done */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 480 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 481 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
