CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: "Kirill A. Shutemov" CC: Will Deacon tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 9e9fb7655ed585da8f468e29221f0ba194a5f613 commit: f9ce0be71d1fbb038ada15ced83474b0e63f264d mm: Cleanup faultaround and finish_fault() codepaths date: 7 months ago :::::: branch date: 7 hours ago :::::: commit date: 7 months ago config: parisc-randconfig-s031-20210830 (attached as .config) compiler: hppa64-linux-gcc (GCC) 11.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-348-gf0e6938b-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f9ce0be71d1fbb038ada15ced83474b0e63f264d git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout f9ce0be71d1fbb038ada15ced83474b0e63f264d # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) mm/memory.c:5087:22: sparse: sparse: cast removes address space '__user' of expression mm/memory.c:771:9: sparse: sparse: context imbalance in 'copy_nonpresent_pte' - different lock contexts for basic block mm/memory.c:899:9: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block mm/memory.c: note: in included file (through include/linux/pgtable.h, arch/parisc/include/asm/io.h, include/linux/io.h, ...): arch/parisc/include/asm/pgtable.h:497:26: sparse: sparse: context imbalance in 'zap_pte_range' - different lock contexts for basic block mm/memory.c:1623:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block mm/memory.c:1643:9: sparse: sparse: context imbalance in 'insert_page_into_pte_locked' - different lock contexts for basic block mm/memory.c:1672:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block mm/memory.c:1963:9: sparse: sparse: context imbalance in 'insert_pfn' - different lock contexts for basic block mm/memory.c:2182:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block mm/memory.c:2419:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock mm/memory.c:2911:17: sparse: sparse: context imbalance in 'wp_page_copy' - different lock contexts for basic block mm/memory.c:3022:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock mm/memory.c:3085:19: sparse: sparse: context imbalance in 'do_wp_page' - different lock contexts for basic block mm/memory.c:3421:9: sparse: sparse: context imbalance in 'do_swap_page' - different lock contexts for basic block mm/memory.c:3577:9: sparse: sparse: context imbalance in 'do_anonymous_page' - different lock contexts for basic block >> mm/memory.c:3744:9: sparse: sparse: context imbalance in 'do_set_pte' - different lock contexts for basic block mm/memory.c: note: in included file (through arch/parisc/include/asm/io.h, include/linux/io.h, include/linux/irq.h, ...): include/linux/pgtable.h:852:9: sparse: sparse: context imbalance in 'do_numa_page' - different lock contexts for basic block mm/memory.c:4341:9: sparse: sparse: context imbalance in 'handle_pte_fault' - different lock contexts for basic block mm/memory.c:4627:5: sparse: sparse: context imbalance in 'follow_pte' - different lock contexts for basic block mm/memory.c:4717:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock vim +/do_set_pte +3744 mm/memory.c 1010245964415b Kirill A. Shutemov 2016-07-26 3723 f9ce0be71d1fbb Kirill A. Shutemov 2020-12-19 3724 void do_set_pte(struct vm_fault *vmf, struct page *page) 3bb977946998ae Kirill A. Shutemov 2014-04-03 3725 { 82b0f8c39a3869 Jan Kara 2016-12-14 3726 struct vm_area_struct *vma = vmf->vma; 82b0f8c39a3869 Jan Kara 2016-12-14 3727 bool write = vmf->flags & FAULT_FLAG_WRITE; 3bb977946998ae Kirill A. Shutemov 2014-04-03 3728 pte_t entry; 7267ec008b5cd8 Kirill A. Shutemov 2016-07-26 3729 3bb977946998ae Kirill A. Shutemov 2014-04-03 3730 flush_icache_page(vma, page); 3bb977946998ae Kirill A. Shutemov 2014-04-03 3731 entry = mk_pte(page, vma->vm_page_prot); 44bf431b47b429 Bibo Mao 2020-05-27 3732 entry = pte_sw_mkyoung(entry); 3bb977946998ae Kirill A. Shutemov 2014-04-03 3733 if (write) 3bb977946998ae Kirill A. Shutemov 2014-04-03 3734 entry = maybe_mkwrite(pte_mkdirty(entry), vma); bae473a423f65e Kirill A. Shutemov 2016-07-26 3735 /* copy-on-write page */ bae473a423f65e Kirill A. Shutemov 2016-07-26 3736 if (write && !(vma->vm_flags & VM_SHARED)) { 3bb977946998ae Kirill A. Shutemov 2014-04-03 3737 inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES); 82b0f8c39a3869 Jan Kara 2016-12-14 3738 page_add_new_anon_rmap(page, vma, vmf->address, false); b518154e59aab3 Joonsoo Kim 2020-08-11 3739 lru_cache_add_inactive_or_unevictable(page, vma); 3bb977946998ae Kirill A. Shutemov 2014-04-03 3740 } else { eca56ff906bdd0 Jerome Marchand 2016-01-14 3741 inc_mm_counter_fast(vma->vm_mm, mm_counter_file(page)); dd78fedde4b99b Kirill A. Shutemov 2016-07-26 3742 page_add_file_rmap(page, false); 3bb977946998ae Kirill A. Shutemov 2014-04-03 3743 } 82b0f8c39a3869 Jan Kara 2016-12-14 @3744 set_pte_at(vma->vm_mm, vmf->address, vmf->pte, entry); 953c66c2b22a30 Aneesh Kumar K.V 2016-12-12 3745 } 3bb977946998ae Kirill A. Shutemov 2014-04-03 3746 :::::: The code at line 3744 was first introduced by commit :::::: 82b0f8c39a3869b6fd2a10e180a862248736ec6f mm: join struct fault_env and vm_fault :::::: TO: Jan Kara :::::: CC: Linus Torvalds --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org