On Mon, May 17, 2021 at 9:49 PM kernel test robot <lkp@xxxxxxxxx> wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: cd557f1c605fc5a2c0eb0b540610f50dc67dd849 > commit: dbee97d1f49a2f2f1f5c26bf15151cc998572e89 [2950/3150] mm/mremap: use pmd/pud_poplulate to update page table entries > config: i386-randconfig-r006-20210517 (attached as .config) > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > reproduce (this is a W=1 build): > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=dbee97d1f49a2f2f1f5c26bf15151cc998572e89 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout dbee97d1f49a2f2f1f5c26bf15151cc998572e89 > # save the attached .config to linux build tree > make W=1 W=1 ARCH=i386 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot <lkp@xxxxxxxxx> > > All warnings (new ones prefixed by >>): > > mm/mremap.c: In function 'move_normal_pud': > >> mm/mremap.c:285:8: warning: variable 'pud' set but not used [-Wunused-but-set-variable] > 285 | pud_t pud; > | ^~~ > > > vim +/pud +285 mm/mremap.c > > 2c91bd4a4e2e53 Joel Fernandes (Google 2019-01-03 278) > c49dd340180260 Kalesh Singh 2020-12-14 279 #ifdef CONFIG_HAVE_MOVE_PUD > c49dd340180260 Kalesh Singh 2020-12-14 280 static bool move_normal_pud(struct vm_area_struct *vma, unsigned long old_addr, > c49dd340180260 Kalesh Singh 2020-12-14 281 unsigned long new_addr, pud_t *old_pud, pud_t *new_pud) > c49dd340180260 Kalesh Singh 2020-12-14 282 { > c49dd340180260 Kalesh Singh 2020-12-14 283 spinlock_t *old_ptl, *new_ptl; > c49dd340180260 Kalesh Singh 2020-12-14 284 struct mm_struct *mm = vma->vm_mm; > c49dd340180260 Kalesh Singh 2020-12-14 @285 pud_t pud; > c49dd340180260 Kalesh Singh 2020-12-14 286 > c49dd340180260 Kalesh Singh 2020-12-14 287 /* > c49dd340180260 Kalesh Singh 2020-12-14 288 * The destination pud shouldn't be established, free_pgtables() > c49dd340180260 Kalesh Singh 2020-12-14 289 * should have released it. > c49dd340180260 Kalesh Singh 2020-12-14 290 */ > c49dd340180260 Kalesh Singh 2020-12-14 291 if (WARN_ON_ONCE(!pud_none(*new_pud))) > c49dd340180260 Kalesh Singh 2020-12-14 292 return false; > c49dd340180260 Kalesh Singh 2020-12-14 293 > c49dd340180260 Kalesh Singh 2020-12-14 294 /* > c49dd340180260 Kalesh Singh 2020-12-14 295 * We don't have to worry about the ordering of src and dst > c49dd340180260 Kalesh Singh 2020-12-14 296 * ptlocks because exclusive mmap_lock prevents deadlock. > c49dd340180260 Kalesh Singh 2020-12-14 297 */ > c49dd340180260 Kalesh Singh 2020-12-14 298 old_ptl = pud_lock(vma->vm_mm, old_pud); > c49dd340180260 Kalesh Singh 2020-12-14 299 new_ptl = pud_lockptr(mm, new_pud); > c49dd340180260 Kalesh Singh 2020-12-14 300 if (new_ptl != old_ptl) > c49dd340180260 Kalesh Singh 2020-12-14 301 spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING); > c49dd340180260 Kalesh Singh 2020-12-14 302 > c49dd340180260 Kalesh Singh 2020-12-14 303 /* Clear the pud */ > c49dd340180260 Kalesh Singh 2020-12-14 304 pud = *old_pud; > c49dd340180260 Kalesh Singh 2020-12-14 305 pud_clear(old_pud); > c49dd340180260 Kalesh Singh 2020-12-14 306 > c49dd340180260 Kalesh Singh 2020-12-14 307 VM_BUG_ON(!pud_none(*new_pud)); > c49dd340180260 Kalesh Singh 2020-12-14 308 > dbee97d1f49a2f Aneesh Kumar K.V 2021-05-14 309 pud_populate(mm, new_pud, (pmd_t *)pud_page_vaddr(pud)); pud is passed to pud_page_vaddr(). > c49dd340180260 Kalesh Singh 2020-12-14 310 flush_tlb_range(vma, old_addr, old_addr + PUD_SIZE); > c49dd340180260 Kalesh Singh 2020-12-14 311 if (new_ptl != old_ptl) > c49dd340180260 Kalesh Singh 2020-12-14 312 spin_unlock(new_ptl); > c49dd340180260 Kalesh Singh 2020-12-14 313 spin_unlock(old_ptl); > c49dd340180260 Kalesh Singh 2020-12-14 314 > c49dd340180260 Kalesh Singh 2020-12-14 315 return true; > c49dd340180260 Kalesh Singh 2020-12-14 316 } > c49dd340180260 Kalesh Singh 2020-12-14 317 #else > c49dd340180260 Kalesh Singh 2020-12-14 318 static inline bool move_normal_pud(struct vm_area_struct *vma, > c49dd340180260 Kalesh Singh 2020-12-14 319 unsigned long old_addr, unsigned long new_addr, pud_t *old_pud, > c49dd340180260 Kalesh Singh 2020-12-14 320 pud_t *new_pud) > c49dd340180260 Kalesh Singh 2020-12-14 321 { > c49dd340180260 Kalesh Singh 2020-12-14 322 return false; > c49dd340180260 Kalesh Singh 2020-12-14 323 } > c49dd340180260 Kalesh Singh 2020-12-14 324 #endif > c49dd340180260 Kalesh Singh 2020-12-14 325 > > :::::: The code at line 285 was first introduced by commit > :::::: c49dd340180260c6239e453263a9a244da9a7c85 mm: speedup mremap on 1GB or larger regions > > :::::: TO: Kalesh Singh <kaleshsingh@xxxxxxxxxx> > :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx