From: kernel test robot <lkp@intel.com>
To: Peter Xu <peterx@redhat.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 3841/3955] mm/memory.c:1678:67: sparse: sparse: incorrect type in initializer (different base types)
Date: Thu, 14 Apr 2022 01:16:26 +0800 [thread overview]
Message-ID: <202204140108.DeRAhWEn-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c97e430ab5539993ab2afc6e80deea80aef9d799
commit: afbef99a0e4dfb0eda864ae9d3c78c9d9ed750ba [3841/3955] mm/hugetlb: only drop uffd-wp special pte if required
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220414/202204140108.DeRAhWEn-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=afbef99a0e4dfb0eda864ae9d3c78c9d9ed750ba
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 afbef99a0e4dfb0eda864ae9d3c78c9d9ed750ba
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/hugetlbfs/ mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
mm/memory.c:1238:1: sparse: sparse: symbol 'vma_needs_copy' was not declared. Should it be static?
>> mm/memory.c:1678:67: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned long zap_flags @@ got restricted zap_flags_t @@
mm/memory.c:1678:67: sparse: expected unsigned long zap_flags
mm/memory.c:1678:67: sparse: got restricted zap_flags_t
mm/memory.c:1031:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
mm/memory.c:1830:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
mm/memory.c:1878:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
mm/memory.c:2380:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
mm/memory.c:2636:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
mm/memory.c:2925:9: sparse: sparse: context imbalance in 'wp_page_copy' - different lock contexts for basic block
mm/memory.c:3277:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
mm/memory.c:3344:19: sparse: sparse: context imbalance in 'do_wp_page' - different lock contexts for basic block
mm/memory.c:5214:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - wrong count at exit
mm/memory.c:5335:23: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock
mm/memory.c:5365:9: sparse: sparse: context imbalance in 'follow_phys' - unexpected unlock
mm/memory.c:5399:9: sparse: sparse: context imbalance in 'generic_access_phys' - unexpected unlock
--
>> mm/hugetlb.c:5013:43: sparse: sparse: restricted zap_flags_t degrades to integer
mm/hugetlb.c:5047:35: sparse: sparse: restricted zap_flags_t degrades to integer
mm/hugetlb.c:460:12: sparse: sparse: context imbalance in 'allocate_file_region_entries' - wrong count at exit
mm/hugetlb.c:533:13: sparse: sparse: context imbalance in 'region_add' - wrong count at exit
mm/hugetlb.c:600:13: sparse: sparse: context imbalance in 'region_chg' - wrong count at exit
mm/hugetlb.c: note: in included file:
include/linux/mm.h:1304:17: sparse: sparse: context imbalance in 'demote_free_huge_page' - unexpected unlock
mm/hugetlb.c:4896:20: sparse: sparse: context imbalance in 'move_huge_pte' - different lock contexts for basic block
include/linux/mm.h:1165:22: sparse: sparse: context imbalance in 'hugetlb_wp' - unexpected unlock
mm/hugetlb.c:6127:25: sparse: sparse: context imbalance in 'follow_hugetlb_page' - different lock contexts for basic block
--
>> fs/hugetlbfs/inode.c:521:41: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned long zap_flags @@ got restricted zap_flags_t [usertype] @@
fs/hugetlbfs/inode.c:521:41: sparse: expected unsigned long zap_flags
fs/hugetlbfs/inode.c:521:41: sparse: got restricted zap_flags_t [usertype]
fs/hugetlbfs/inode.c:588:39: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned long zap_flags @@ got restricted zap_flags_t [usertype] @@
fs/hugetlbfs/inode.c:588:39: sparse: expected unsigned long zap_flags
fs/hugetlbfs/inode.c:588:39: sparse: got restricted zap_flags_t [usertype]
vim +1678 mm/memory.c
1642
1643
1644 static void unmap_single_vma(struct mmu_gather *tlb,
1645 struct vm_area_struct *vma, unsigned long start_addr,
1646 unsigned long end_addr,
1647 struct zap_details *details)
1648 {
1649 unsigned long start = max(vma->vm_start, start_addr);
1650 unsigned long end;
1651
1652 if (start >= vma->vm_end)
1653 return;
1654 end = min(vma->vm_end, end_addr);
1655 if (end <= vma->vm_start)
1656 return;
1657
1658 if (vma->vm_file)
1659 uprobe_munmap(vma, start, end);
1660
1661 if (unlikely(vma->vm_flags & VM_PFNMAP))
1662 untrack_pfn(vma, 0, 0);
1663
1664 if (start != end) {
1665 if (unlikely(is_vm_hugetlb_page(vma))) {
1666 /*
1667 * It is undesirable to test vma->vm_file as it
1668 * should be non-null for valid hugetlb area.
1669 * However, vm_file will be NULL in the error
1670 * cleanup path of mmap_region. When
1671 * hugetlbfs ->mmap method fails,
1672 * mmap_region() nullifies vma->vm_file
1673 * before calling this function to clean up.
1674 * Since no pte has actually been setup, it is
1675 * safe to do nothing in this case.
1676 */
1677 if (vma->vm_file) {
> 1678 unsigned long zap_flags = details ?
1679 details->zap_flags : 0;
1680 i_mmap_lock_write(vma->vm_file->f_mapping);
1681 __unmap_hugepage_range_final(tlb, vma, start, end,
1682 NULL, zap_flags);
1683 i_mmap_unlock_write(vma->vm_file->f_mapping);
1684 }
1685 } else
1686 unmap_page_range(tlb, vma, start, end, details);
1687 }
1688 }
1689
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-04-13 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 17:16 kernel test robot [this message]
2022-04-13 19:00 ` [linux-next:master 3841/3955] mm/memory.c:1678:67: sparse: sparse: incorrect type in initializer (different base types) Peter Xu
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=202204140108.DeRAhWEn-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=peterx@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).