Re: [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]

 



On Wed, 26 Jun 2024 05:39:54 +0800 kernel test robot <lkp@xxxxxxxxx> 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@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.
> 
> 

um yes. 
https://lore.kernel.org/all/20240622100057.3352-1-ioworker0@xxxxxxxxx/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)
_





[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