From: kernel test robot <lkp@intel.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 2950/3150] mm/mremap.c:285:8: warning: variable 'pud' set but not used
Date: Tue, 18 May 2021 00:19:03 +0800 [thread overview]
Message-ID: <202105180059.7qbrqAhs-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5416 bytes --]
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@intel.com>
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));
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@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42233 bytes --]
next reply other threads:[~2021-05-17 16:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 16:19 kernel test robot [this message]
2021-05-18 19:31 ` Souptick Joarder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202105180059.7qbrqAhs-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox