[linux-next:master 7701/8232] mm/huge_memory.c:2735:31: warning: variable 'page' is uninitialized when used here

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406260514.SLhNM9kQ-lkp@xxxxxxxxx/

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux