Re: [PATCH 2/3] mm/mmu_notifier: use structure for invalidate_range_start/end calls

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

 



Hi Jérôme,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.20-rc5]
[cannot apply to next-20181206]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/jglisse-redhat-com/mmu-notifier-contextual-informations/20181207-031930
config: i386-randconfig-x007-201848 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   kernel/events/uprobes.c: In function '__replace_page':
>> kernel/events/uprobes.c:174:28: error: storage size of 'range' isn't known
     struct mmu_notifier_range range;
                               ^~~~~
   kernel/events/uprobes.c:174:28: warning: unused variable 'range' [-Wunused-variable]

vim +174 kernel/events/uprobes.c

   152	
   153	/**
   154	 * __replace_page - replace page in vma by new page.
   155	 * based on replace_page in mm/ksm.c
   156	 *
   157	 * @vma:      vma that holds the pte pointing to page
   158	 * @addr:     address the old @page is mapped at
   159	 * @page:     the cowed page we are replacing by kpage
   160	 * @kpage:    the modified page we replace page by
   161	 *
   162	 * Returns 0 on success, -EFAULT on failure.
   163	 */
   164	static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
   165					struct page *old_page, struct page *new_page)
   166	{
   167		struct mm_struct *mm = vma->vm_mm;
   168		struct page_vma_mapped_walk pvmw = {
   169			.page = old_page,
   170			.vma = vma,
   171			.address = addr,
   172		};
   173		int err;
 > 174		struct mmu_notifier_range range;
   175		struct mem_cgroup *memcg;
   176	
   177		range.start = addr;
   178		range.end = addr + PAGE_SIZE;
   179		range.mm = mm;
   180	
   181		VM_BUG_ON_PAGE(PageTransHuge(old_page), old_page);
   182	
   183		err = mem_cgroup_try_charge(new_page, vma->vm_mm, GFP_KERNEL, &memcg,
   184				false);
   185		if (err)
   186			return err;
   187	
   188		/* For try_to_free_swap() and munlock_vma_page() below */
   189		lock_page(old_page);
   190	
   191		mmu_notifier_invalidate_range_start(&range);
   192		err = -EAGAIN;
   193		if (!page_vma_mapped_walk(&pvmw)) {
   194			mem_cgroup_cancel_charge(new_page, memcg, false);
   195			goto unlock;
   196		}
   197		VM_BUG_ON_PAGE(addr != pvmw.address, old_page);
   198	
   199		get_page(new_page);
   200		page_add_new_anon_rmap(new_page, vma, addr, false);
   201		mem_cgroup_commit_charge(new_page, memcg, false, false);
   202		lru_cache_add_active_or_unevictable(new_page, vma);
   203	
   204		if (!PageAnon(old_page)) {
   205			dec_mm_counter(mm, mm_counter_file(old_page));
   206			inc_mm_counter(mm, MM_ANONPAGES);
   207		}
   208	
   209		flush_cache_page(vma, addr, pte_pfn(*pvmw.pte));
   210		ptep_clear_flush_notify(vma, addr, pvmw.pte);
   211		set_pte_at_notify(mm, addr, pvmw.pte,
   212				mk_pte(new_page, vma->vm_page_prot));
   213	
   214		page_remove_rmap(old_page, false);
   215		if (!page_mapped(old_page))
   216			try_to_free_swap(old_page);
   217		page_vma_mapped_walk_done(&pvmw);
   218	
   219		if (vma->vm_flags & VM_LOCKED)
   220			munlock_vma_page(old_page);
   221		put_page(old_page);
   222	
   223		err = 0;
   224	 unlock:
   225		mmu_notifier_invalidate_range_end(&range);
   226		unlock_page(old_page);
   227		return err;
   228	}
   229	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux