From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E60FDC433ED for ; Tue, 18 May 2021 19:32:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7133461059 for ; Tue, 18 May 2021 19:32:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7133461059 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B0BDB8E003E; Tue, 18 May 2021 15:31:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABDC98E002F; Tue, 18 May 2021 15:31:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 936FD8E003E; Tue, 18 May 2021 15:31:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 633978E002F for ; Tue, 18 May 2021 15:31:59 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F2CE38249980 for ; Tue, 18 May 2021 19:31:58 +0000 (UTC) X-FDA: 78155347158.22.8DDB5A1 Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.44]) by imf06.hostedemail.com (Postfix) with ESMTP id 92821C0007E8 for ; Tue, 18 May 2021 19:31:57 +0000 (UTC) Received: by mail-vs1-f44.google.com with SMTP id x13so5547092vsh.1 for ; Tue, 18 May 2021 12:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2OU3zsh3Pa8ztRV/rB0BAuOHkbuAhs/6nlaXR8WKEVk=; b=ozNZMNHxxe+xNGOgxwOf9BksIBnWvetoZs2P35V7JCCvOllcBHAeHQgiM2cpDdEZsN hRU4MB/1TNpNL1ZBtaJdbpbJEUi1IDQVDb7y3IkzhqdmEsG/373Xv2ljCyD+UYZZAK/5 f6om+Gp+e8dSrkPKsWu+jbThyCuJOu/IbJ9U5FN52H60IKQsqXko1lnz70SpWhySXxfd nuBBhki++8OxX2DibElTgaEzn8WWmrQbV1RVw0qPzb9lrEwMwJjSZ8PoNarePclHSKIQ HcqiSn6Uv0tSDdcrr87p5CDe8I4Go0EQMbEsm5nZxCnh1i4L2dkwa61VQcJwn7I9c/le pemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2OU3zsh3Pa8ztRV/rB0BAuOHkbuAhs/6nlaXR8WKEVk=; b=VKZYcCt2gtq2YeNU/W8rDpze/UFKQaGWIHxilh5i750YPs5VOU63GW1BEh7B83jlP5 NUcgWeyedAAjzDcCrlm6SB/x1aKrUIVmpbBpuShxd/O7BtFutLmtsKXoWSazASdAPzcl DSbsmfTVN+BVKLvfMg46cYn1KiPZmqEGBM09S9JGLZo1qVnpeHSfMXjkD4LZJMzxdEPL oG/T58sDtKcl9yGa0u0LRoX1PUWxlwbCSr/RAXtcSgpWFwzBEUi2c7IiUi5MlM3wDEEH xVlvnGA9EZneg9iI/VI4H8BRpN5Yte+wO/d7HEfkBG0m1X5GAv9dIN7+7bbIstttF++2 YjHQ== X-Gm-Message-State: AOAM5303iPhMGFP8NH6qtT+jGtD7FgpIsmqRi4TbTyP1Ljx1TtXL084G QW9PO0bqi+n20ry2yWtLEw1CZ/zKgIp/Bgj+ahg= X-Google-Smtp-Source: ABdhPJzTgg/m0VQOfyfqx1WTqZdMAmgLluC83IJhtFu8B8y+nxQBvsR7I4UK9VTT8AeK64m5//WcqyrkMizUDVnD7uM= X-Received: by 2002:a67:e997:: with SMTP id b23mr7635677vso.59.1621366317863; Tue, 18 May 2021 12:31:57 -0700 (PDT) MIME-Version: 1.0 References: <202105180059.7qbrqAhs-lkp@intel.com> In-Reply-To: <202105180059.7qbrqAhs-lkp@intel.com> From: Souptick Joarder Date: Wed, 19 May 2021 01:01:45 +0530 Message-ID: Subject: Re: [linux-next:master 2950/3150] mm/mremap.c:285:8: warning: variable 'pud' set but not used To: kernel test robot Cc: "Aneesh Kumar K.V" , kbuild-all@lists.01.org, Linux Memory Management List , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 92821C0007E8 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=ozNZMNHx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of jrdrlinux@gmail.com designates 209.85.217.44 as permitted sender) smtp.mailfrom=jrdrlinux@gmail.com X-Rspamd-Server: rspam03 X-Stat-Signature: eeoo58ffb4wpjhcyyycrotdadwtrxg6e X-HE-Tag: 1621366317-163444 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 17, 2021 at 9:49 PM kernel test robot 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 > > 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 > :::::: CC: Linus Torvalds > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org