[linux-next:master 3462/3504] mm/huge_memory.c:207:13: sparse: sparse: incorrect type in argument 2 (different base types)

[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:   727900b675b749c40ba1f6669c7ae5eb7eb8e837
commit: 284f5619c605dadceadcad1e807cd08503ae13c5 [3462/3504] Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
config: riscv-randconfig-r112-20240403 (https://download.01.org/0day-ci/archive/20240404/202404041017.bDUZVz4r-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240404/202404041017.bDUZVz4r-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/202404041017.bDUZVz4r-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned long [usertype] old @@     got struct folio *__old @@
   mm/huge_memory.c:207:13: sparse:     expected unsigned long [usertype] old
   mm/huge_memory.c:207:13: sparse:     got struct folio *__old
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned long [usertype] new @@     got struct folio *__new @@
   mm/huge_memory.c:207:13: sparse:     expected unsigned long [usertype] new
   mm/huge_memory.c:207:13: sparse:     got struct folio *__new
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected struct folio *__ret @@     got unsigned long @@
   mm/huge_memory.c:207:13: sparse:     expected struct folio *__ret
   mm/huge_memory.c:207:13: sparse:     got unsigned long
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned long [usertype] old @@     got struct folio *__old @@
   mm/huge_memory.c:207:13: sparse:     expected unsigned long [usertype] old
   mm/huge_memory.c:207:13: sparse:     got struct folio *__old
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned long [usertype] new @@     got struct folio *__new @@
   mm/huge_memory.c:207:13: sparse:     expected unsigned long [usertype] new
   mm/huge_memory.c:207:13: sparse:     got struct folio *__new
>> mm/huge_memory.c:207:13: sparse: sparse: incorrect type in assignment (different base types) @@     expected struct folio *__ret @@     got unsigned long @@
   mm/huge_memory.c:207:13: sparse:     expected struct folio *__ret
   mm/huge_memory.c:207:13: sparse:     got unsigned long
   mm/huge_memory.c:1743:20: sparse: sparse: context imbalance in 'madvise_free_huge_pmd' - unexpected unlock
   mm/huge_memory.c:1781:28: sparse: sparse: context imbalance in 'zap_huge_pmd' - unexpected unlock
   mm/huge_memory.c:1892:28: sparse: sparse: context imbalance in 'move_huge_pmd' - unexpected unlock
   mm/huge_memory.c:2033:20: sparse: sparse: context imbalance in 'change_huge_pmd' - unexpected unlock
   mm/huge_memory.c:2068:28: sparse: sparse: context imbalance in 'move_pages_huge_pmd' - unexpected unlock
   mm/huge_memory.c:2183:12: sparse: sparse: context imbalance in '__pmd_trans_huge_lock' - wrong count at exit
   mm/huge_memory.c:2303:18: sparse: sparse: context imbalance in '__split_huge_zero_page_pmd' - unexpected unlock
   mm/huge_memory.c:2514:18: sparse: sparse: context imbalance in '__split_huge_pmd_locked' - unexpected unlock
   mm/huge_memory.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/mm.h):
   include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
   mm/huge_memory.c:2841:9: sparse: sparse: context imbalance in '__split_huge_page' - different lock contexts for basic block
   mm/huge_memory.c:3098:17: sparse: sparse: context imbalance in 'split_huge_page_to_list_to_order' - different lock contexts for basic block
   include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false

vim +207 mm/huge_memory.c

7635d9cbe8327e Michal Hocko            2018-12-28  192  
aaa9705b4af360 Miaohe Lin              2021-05-04  193  static bool get_huge_zero_page(void)
97ae17497e996f Kirill A. Shutemov      2012-12-12  194  {
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26  195) 	struct folio *zero_folio;
97ae17497e996f Kirill A. Shutemov      2012-12-12  196  retry:
97ae17497e996f Kirill A. Shutemov      2012-12-12  197  	if (likely(atomic_inc_not_zero(&huge_zero_refcount)))
aaa9705b4af360 Miaohe Lin              2021-05-04  198  		return true;
97ae17497e996f Kirill A. Shutemov      2012-12-12  199  
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26  200) 	zero_folio = folio_alloc((GFP_TRANSHUGE | __GFP_ZERO) & ~__GFP_MOVABLE,
4a6c1297268c91 Kirill A. Shutemov      2012-12-12  201  			HPAGE_PMD_ORDER);
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26  202) 	if (!zero_folio) {
d8a8e1f0da3d29 Kirill A. Shutemov      2012-12-12  203  		count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
aaa9705b4af360 Miaohe Lin              2021-05-04  204  		return false;
d8a8e1f0da3d29 Kirill A. Shutemov      2012-12-12  205  	}
97ae17497e996f Kirill A. Shutemov      2012-12-12  206  	preempt_disable();
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26 @207) 	if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) {
97ae17497e996f Kirill A. Shutemov      2012-12-12  208  		preempt_enable();
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26  209) 		folio_put(zero_folio);
97ae17497e996f Kirill A. Shutemov      2012-12-12  210  		goto retry;
4a6c1297268c91 Kirill A. Shutemov      2012-12-12  211  	}
6c768b74689de7 Matthew Wilcox (Oracle  2024-03-26  212) 	WRITE_ONCE(huge_zero_pfn, folio_pfn(zero_folio));
4a6c1297268c91 Kirill A. Shutemov      2012-12-12  213  
97ae17497e996f Kirill A. Shutemov      2012-12-12  214  	/* We take additional reference here. It will be put back by shrinker */
97ae17497e996f Kirill A. Shutemov      2012-12-12  215  	atomic_set(&huge_zero_refcount, 2);
97ae17497e996f Kirill A. Shutemov      2012-12-12  216  	preempt_enable();
f4981502088f8e Liu Shixin              2022-09-09  217  	count_vm_event(THP_ZERO_PAGE_ALLOC);
aaa9705b4af360 Miaohe Lin              2021-05-04  218  	return true;
97ae17497e996f Kirill A. Shutemov      2012-12-12  219  }
97ae17497e996f Kirill A. Shutemov      2012-12-12  220  

:::::: The code at line 207 was first introduced by commit
:::::: 6c768b74689de72ea86a428597acc9f0ef0c9236 mm: convert huge_zero_page to huge_zero_folio

:::::: TO: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
:::::: CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

-- 
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