Re: [linux-next:master 11904/12006] include/linux/hugetlb.h:1262:56: error: invalid use of undefined type 'struct hugetlb_vma_lock'

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

 



On Wed, Nov 30, 2022 at 08:33:11PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   700e0cd3a5ce6a2cb90d9a2aab729b52f092a7d6
> commit: 98438ed47d60a6d30d5d2ad9c8786a0b92ca23f2 [11904/12006] mm/hugetlb: introduce hugetlb_walk()
> config: i386-randconfig-r004-20221128
> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
> reproduce (this is a W=1 build):
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=98438ed47d60a6d30d5d2ad9c8786a0b92ca23f2
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout 98438ed47d60a6d30d5d2ad9c8786a0b92ca23f2
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from arch/x86/include/asm/bug.h:87,
>                     from include/linux/bug.h:5,
>                     from include/linux/thread_info.h:13,
>                     from arch/x86/include/asm/preempt.h:7,
>                     from include/linux/preempt.h:78,
>                     from include/linux/spinlock.h:56,
>                     from include/linux/wait.h:9,
>                     from include/linux/wait_bit.h:8,
>                     from include/linux/fs.h:6,
>                     from fs/ubifs/ubifs.h:16,
>                     from fs/ubifs/file.c:40:
>    include/linux/hugetlb.h: In function 'hugetlb_walk':
> >> include/linux/hugetlb.h:1262:56: error: invalid use of undefined type 'struct hugetlb_vma_lock'
>     1262 |                 WARN_ON_ONCE(!lockdep_is_held(&vma_lock->rw_sema) &&
>          |                                                        ^~
>    include/asm-generic/bug.h:110:32: note: in definition of macro 'WARN_ON_ONCE'
>      110 |         int __ret_warn_on = !!(condition);                      \
>          |                                ^~~~~~~~~
>    include/linux/hugetlb.h:1262:31: note: in expansion of macro 'lockdep_is_held'
>     1262 |                 WARN_ON_ONCE(!lockdep_is_held(&vma_lock->rw_sema) &&
>          |                               ^~~~~~~~~~~~~~~
> --
>    In file included from arch/x86/include/asm/bug.h:87,
>                     from include/linux/bug.h:5,
>                     from include/linux/fortify-string.h:5,
>                     from include/linux/string.h:253,
>                     from include/linux/bitmap.h:11,
>                     from include/linux/cpumask.h:12,
>                     from include/linux/smp.h:13,
>                     from include/linux/lockdep.h:14,
>                     from include/linux/mutex.h:17,
>                     from include/linux/notifier.h:14,
>                     from include/linux/clk.h:14,
>                     from lib/vsprintf.c:22:
>    include/linux/hugetlb.h: In function 'hugetlb_walk':
> >> include/linux/hugetlb.h:1262:56: error: invalid use of undefined type 'struct hugetlb_vma_lock'
>     1262 |                 WARN_ON_ONCE(!lockdep_is_held(&vma_lock->rw_sema) &&
>          |                                                        ^~
>    include/asm-generic/bug.h:110:32: note: in definition of macro 'WARN_ON_ONCE'
>      110 |         int __ret_warn_on = !!(condition);                      \
>          |                                ^~~~~~~~~
>    include/linux/hugetlb.h:1262:31: note: in expansion of macro 'lockdep_is_held'
>     1262 |                 WARN_ON_ONCE(!lockdep_is_held(&vma_lock->rw_sema) &&
>          |                               ^~~~~~~~~~~~~~~
>    lib/vsprintf.c: In function 'va_format':
>    lib/vsprintf.c:1685:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
>     1685 |         buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
>          |         ^~~
> 
> 
> vim +1262 include/linux/hugetlb.h
> 
>   1243	
>   1244	/*
>   1245	 * Safe version of huge_pte_offset() to check the locks.  See comments
>   1246	 * above huge_pte_offset().
>   1247	 */
>   1248	static inline pte_t *
>   1249	hugetlb_walk(struct vm_area_struct *vma, unsigned long addr, unsigned long sz)
>   1250	{
>   1251	#if defined(CONFIG_ARCH_WANT_HUGE_PMD_SHARE) && defined(CONFIG_LOCKDEP)
>   1252		struct hugetlb_vma_lock *vma_lock = vma->vm_private_data;
>   1253	
>   1254		/*
>   1255		 * If pmd sharing possible, locking needed to safely walk the
>   1256		 * hugetlb pgtables.  More information can be found at the comment
>   1257		 * above huge_pte_offset() in the same file.
>   1258		 *
>   1259		 * NOTE: lockdep_is_held() is only defined with CONFIG_LOCKDEP.
>   1260		 */
>   1261		if (__vma_shareable_flags_pmd(vma))
> > 1262			WARN_ON_ONCE(!lockdep_is_held(&vma_lock->rw_sema) &&
>   1263				     !lockdep_is_held(
>   1264					 &vma->vm_file->f_mapping->i_mmap_rwsem));
>   1265	#endif
>   1266		return huge_pte_offset(vma->vm_mm, addr, sz);
>   1267	}
>   1268	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp

[...]

> CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y

This looks like the same issue as what Eric reported here:

https://lore.kernel.org/all/Y4d4qh0ACmo455Nj@x1n/

Thanks,

-- 
Peter Xu





[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