From: kernel test robot <lkp@intel.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: oe-kbuild-all@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [akpm-mm:mm-unstable 174/199] mm/memory.c:5094:25: warning: variable 'pte' is uninitialized when used here
Date: Thu, 28 Mar 2024 08:58:52 +0800 [thread overview]
Message-ID: <202403280834.zWjRlaM9-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head: 2f423131bebaa5a4f4b8cf460d96245e93a40905
commit: 0f47c75aeb7aae02c433e322ebbd4d6d757418d5 [174/199] mm: support multi-size THP numa balancing
config: x86_64-randconfig-123-20240327 (https://download.01.org/0day-ci/archive/20240328/202403280834.zWjRlaM9-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240328/202403280834.zWjRlaM9-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/202403280834.zWjRlaM9-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/memory.c:5094:25: warning: variable 'pte' is uninitialized when used here [-Wuninitialized]
5094 | writable = pte_write(pte);
| ^~~
mm/memory.c:5083:3: note: variable 'pte' is declared here
5083 | pte_t pte, old_pte;
| ^
1 warning generated.
vim +/pte +5094 mm/memory.c
5070
5071 static void numa_rebuild_large_mapping(struct vm_fault *vmf, struct vm_area_struct *vma,
5072 struct folio *folio, pte_t fault_pte, bool ignore_writable)
5073 {
5074 int nr = pte_pfn(fault_pte) - folio_pfn(folio);
5075 unsigned long start = max(vmf->address - nr * PAGE_SIZE, vma->vm_start);
5076 unsigned long end = min(start + folio_nr_pages(folio) * PAGE_SIZE, vma->vm_end);
5077 pte_t *start_ptep = vmf->pte - (vmf->address - start) / PAGE_SIZE;
5078 bool pte_write_upgrade = vma_wants_manual_pte_write_upgrade(vma);
5079 unsigned long addr;
5080
5081 /* Restore all PTEs' mapping of the large folio */
5082 for (addr = start; addr != end; start_ptep++, addr += PAGE_SIZE) {
5083 pte_t pte, old_pte;
5084 pte_t ptent = ptep_get(start_ptep);
5085 bool writable = false;
5086
5087 if (!pte_present(ptent) || !pte_protnone(ptent))
5088 continue;
5089
5090 if (vm_normal_folio(vma, addr, ptent) != folio)
5091 continue;
5092
5093 if (!ignore_writable) {
> 5094 writable = pte_write(pte);
5095 if (!writable && pte_write_upgrade &&
5096 can_change_pte_writable(vma, addr, pte))
5097 writable = true;
5098 }
5099
5100 old_pte = ptep_modify_prot_start(vma, addr, start_ptep);
5101 pte = pte_modify(old_pte, vma->vm_page_prot);
5102 pte = pte_mkyoung(pte);
5103 if (writable)
5104 pte = pte_mkwrite(pte, vma);
5105 ptep_modify_prot_commit(vma, addr, start_ptep, old_pte, pte);
5106 update_mmu_cache_range(vmf, vma, addr, start_ptep, 1);
5107 }
5108 }
5109
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-28 0:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202403280834.zWjRlaM9-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=linux-mm@kvack.org \
--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