From: kernel test robot <lkp@intel.com>
To: Lance Yang <ioworker0@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 7701/8232] mm/huge_memory.c:2735:31: warning: variable 'page' is uninitialized when used here
Date: Wed, 26 Jun 2024 05:39:54 +0800 [thread overview]
Message-ID: <202406260514.SLhNM9kQ-lkp@intel.com> (raw)
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.
vim +/page +2735 mm/huge_memory.c
2691
2692 static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
2693 unsigned long addr, pmd_t *pmdp,
2694 struct folio *folio)
2695 {
2696 struct mm_struct *mm = vma->vm_mm;
2697 int ref_count, map_count;
2698 pmd_t orig_pmd = *pmdp;
2699 struct page *page;
2700
2701 if (folio_test_dirty(folio) || pmd_dirty(orig_pmd))
2702 return false;
2703
2704 orig_pmd = pmdp_huge_clear_flush(vma, addr, pmdp);
2705
2706 /*
2707 * Syncing against concurrent GUP-fast:
2708 * - clear PMD; barrier; read refcount
2709 * - inc refcount; barrier; read PMD
2710 */
2711 smp_mb();
2712
2713 ref_count = folio_ref_count(folio);
2714 map_count = folio_mapcount(folio);
2715
2716 /*
2717 * Order reads for folio refcount and dirty flag
2718 * (see comments in __remove_mapping()).
2719 */
2720 smp_rmb();
2721
2722 /*
2723 * If the folio or its PMD is redirtied at this point, or if there
2724 * are unexpected references, we will give up to discard this folio
2725 * and remap it.
2726 *
2727 * The only folio refs must be one from isolation plus the rmap(s).
2728 */
2729 if (folio_test_dirty(folio) || pmd_dirty(orig_pmd) ||
2730 ref_count != map_count + 1) {
2731 set_pmd_at(mm, addr, pmdp, orig_pmd);
2732 return false;
2733 }
2734
> 2735 folio_remove_rmap_pmd(folio, page, vma);
2736 zap_deposited_table(mm, pmdp);
2737 add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
2738 if (vma->vm_flags & VM_LOCKED)
2739 mlock_drain_local();
2740 folio_put(folio);
2741
2742 return true;
2743 }
2744
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-06-25 21:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 21:39 kernel test robot [this message]
2024-06-25 21:52 ` Andrew Morton
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=202406260514.SLhNM9kQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ioworker0@gmail.com \
--cc=linux-mm@kvack.org \
--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