From: Andrew Morton <akpm@linux-foundation.org>
To: kernel test robot <lkp@intel.com>
Cc: Lance Yang <ioworker0@gmail.com>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 7701/8232] mm/huge_memory.c:2735:31: warning: variable 'page' is uninitialized when used here
Date: Tue, 25 Jun 2024 14:52:52 -0700 [thread overview]
Message-ID: <20240625145252.d78d18a109cb6bf84eefb5f7@linux-foundation.org> (raw)
In-Reply-To: <202406260514.SLhNM9kQ-lkp@intel.com>
On Wed, 26 Jun 2024 05:39:54 +0800 kernel test robot <lkp@intel.com> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 0fc4bfab2cd45f9acb86c4f04b5191e114e901ed
> commit: 4627108658d68fad359600dbe667b88b501cee71 [7701/8232] mm/vmscan: avoid split lazyfree THP during shrink_folio_list()
> config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240626/202406260514.SLhNM9kQ-lkp@intel.com/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240626/202406260514.SLhNM9kQ-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202406260514.SLhNM9kQ-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> mm/huge_memory.c:2735:31: warning: variable 'page' is uninitialized when used here [-Wuninitialized]
> 2735 | folio_remove_rmap_pmd(folio, page, vma);
> | ^~~~
> mm/huge_memory.c:2699:19: note: initialize the variable 'page' to silence this warning
> 2699 | struct page *page;
> | ^
> | = NULL
> 1 warning generated.
>
>
um yes.
https://lore.kernel.org/all/20240622100057.3352-1-ioworker0@gmail.com/T/#u
removed the initialization.
I'll do this, because I'm about to push a tree out:
--- a/mm/huge_memory.c~hack
+++ a/mm/huge_memory.c
@@ -2697,7 +2697,6 @@ static bool __discard_anon_folio_pmd_loc
struct mm_struct *mm = vma->vm_mm;
int ref_count, map_count;
pmd_t orig_pmd = *pmdp;
- struct page *page;
if (folio_test_dirty(folio) || pmd_dirty(orig_pmd))
return false;
@@ -2733,7 +2732,7 @@ static bool __discard_anon_folio_pmd_loc
return false;
}
- folio_remove_rmap_pmd(folio, page, vma);
+ folio_remove_rmap_pmd(folio, pmd_page(orig_pmd), vma);
zap_deposited_table(mm, pmdp);
add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
if (vma->vm_flags & VM_LOCKED)
_
next prev parent reply other threads:[~2024-06-25 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 21:39 kernel test robot
2024-06-25 21:52 ` Andrew Morton [this message]
2024-06-26 1:26 ` Lance Yang
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=20240625145252.d78d18a109cb6bf84eefb5f7@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ioworker0@gmail.com \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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