tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes head: f445421fe4c764e7c2e61e37322294ba2ea1ceae commit: 8dd5b06d906e56e1838f345eb996228003bbe8ff [317/391] mm/khugepaged: fix GUP-fast interaction by freeing ptes via mmu_gather config: arm64-randconfig-r002-20221124 compiler: aarch64-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=8dd5b06d906e56e1838f345eb996228003bbe8ff git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next pending-fixes git checkout 8dd5b06d906e56e1838f345eb996228003bbe8ff # 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=arm64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): mm/khugepaged.c: In function 'collapse_and_free_pmd': >> mm/khugepaged.c:1422:15: warning: 'pmd.pud.p4d.pgd.pgd' is used uninitialized [-Wuninitialized] 1422 | pmd_t pmd; | ^~~ vim +1422 mm/khugepaged.c 27e1f8273113ad Song Liu 2019-09-23 1401 51c0677f0cab1c Jann Horn 2022-11-23 1402 /* 51c0677f0cab1c Jann Horn 2022-11-23 1403 * A note about locking: 51c0677f0cab1c Jann Horn 2022-11-23 1404 * Trying to take the page table spinlocks would be useless here because those 51c0677f0cab1c Jann Horn 2022-11-23 1405 * are only used to synchronize: 51c0677f0cab1c Jann Horn 2022-11-23 1406 * 51c0677f0cab1c Jann Horn 2022-11-23 1407 * - modifying terminal entries (ones that point to a data page, not to another 51c0677f0cab1c Jann Horn 2022-11-23 1408 * page table) 51c0677f0cab1c Jann Horn 2022-11-23 1409 * - installing *new* non-terminal entries 51c0677f0cab1c Jann Horn 2022-11-23 1410 * 51c0677f0cab1c Jann Horn 2022-11-23 1411 * Instead, we need roughly the same kind of protection as free_pgtables() or 51c0677f0cab1c Jann Horn 2022-11-23 1412 * mm_take_all_locks() (but only for a single VMA): 51c0677f0cab1c Jann Horn 2022-11-23 1413 * The mmap lock together with this VMA's rmap locks covers all paths towards 51c0677f0cab1c Jann Horn 2022-11-23 1414 * the page table entries we're messing with here, except for hardware page 51c0677f0cab1c Jann Horn 2022-11-23 1415 * table walks and lockless_pages_from_mm(). 8dd5b06d906e56 Jann Horn 2022-11-23 1416 * 8dd5b06d906e56 Jann Horn 2022-11-23 1417 * This function is similar to free_pte_range(). 51c0677f0cab1c Jann Horn 2022-11-23 1418 */ e59a47b8a45353 Pasha Tatashin 2022-02-03 1419 static void collapse_and_free_pmd(struct mm_struct *mm, struct vm_area_struct *vma, e59a47b8a45353 Pasha Tatashin 2022-02-03 1420 unsigned long addr, pmd_t *pmdp) e59a47b8a45353 Pasha Tatashin 2022-02-03 1421 { e59a47b8a45353 Pasha Tatashin 2022-02-03 @1422 pmd_t pmd; 8dd5b06d906e56 Jann Horn 2022-11-23 1423 struct mmu_gather tlb; e59a47b8a45353 Pasha Tatashin 2022-02-03 1424 80110bbfbba6f0 Pasha Tatashin 2022-02-03 1425 mmap_assert_write_locked(mm); 51c0677f0cab1c Jann Horn 2022-11-23 1426 if (vma->vm_file) 51c0677f0cab1c Jann Horn 2022-11-23 1427 lockdep_assert_held_write(&vma->vm_file->f_mapping->i_mmap_rwsem); 51c0677f0cab1c Jann Horn 2022-11-23 1428 /* 51c0677f0cab1c Jann Horn 2022-11-23 1429 * All anon_vmas attached to the VMA have the same root and are 51c0677f0cab1c Jann Horn 2022-11-23 1430 * therefore locked by the same lock. 51c0677f0cab1c Jann Horn 2022-11-23 1431 */ 51c0677f0cab1c Jann Horn 2022-11-23 1432 if (vma->anon_vma) 51c0677f0cab1c Jann Horn 2022-11-23 1433 lockdep_assert_held_write(&vma->anon_vma->root->rwsem); 8dd5b06d906e56 Jann Horn 2022-11-23 1434 page_table_check_pte_clear_range(mm, addr, pmd); 51c0677f0cab1c Jann Horn 2022-11-23 1435 8dd5b06d906e56 Jann Horn 2022-11-23 1436 tlb_gather_mmu(&tlb, mm); 8dd5b06d906e56 Jann Horn 2022-11-23 1437 pmd = READ_ONCE(*pmdp); 8dd5b06d906e56 Jann Horn 2022-11-23 1438 pmd_clear(pmdp); 8dd5b06d906e56 Jann Horn 2022-11-23 1439 tlb_flush_pte_range(&tlb, addr, HPAGE_PMD_SIZE); 8dd5b06d906e56 Jann Horn 2022-11-23 1440 pte_free_tlb(&tlb, pmd_pgtable(pmd), addr); 8dd5b06d906e56 Jann Horn 2022-11-23 1441 tlb_finish_mmu(&tlb); e59a47b8a45353 Pasha Tatashin 2022-02-03 1442 mm_dec_nr_ptes(mm); e59a47b8a45353 Pasha Tatashin 2022-02-03 1443 } e59a47b8a45353 Pasha Tatashin 2022-02-03 1444 :::::: The code at line 1422 was first introduced by commit :::::: e59a47b8a45353d9ee234aab2d229474e09885df mm/khugepaged: unify collapse pmd clear, flush and free :::::: TO: Pasha Tatashin :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://01.org/lkp