Re: [PATCH 3/3] mm/mmu_notifier: contextual information for event triggering invalidation

From: kbuild test robot
Date: Thu Dec 06 2018 - 15:54:50 EST


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:177:16: error: 'MMU_NOTIFY_CLEAR' undeclared (first use in this function); did you mean 'VM_ARCH_CLEAR'?
range.event = MMU_NOTIFY_CLEAR;
^~~~~~~~~~~~~~~~
VM_ARCH_CLEAR
kernel/events/uprobes.c:177:16: note: each undeclared identifier is reported only once for each function it appears in
kernel/events/uprobes.c:174:28: warning: unused variable 'range' [-Wunused-variable]
struct mmu_notifier_range range;
^~~~~

vim +177 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.event = MMU_NOTIFY_CLEAR;
178 range.start = addr;
179 range.end = addr + PAGE_SIZE;
180 range.mm = mm;
181
182 VM_BUG_ON_PAGE(PageTransHuge(old_page), old_page);
183
184 err = mem_cgroup_try_charge(new_page, vma->vm_mm, GFP_KERNEL, &memcg,
185 false);
186 if (err)
187 return err;
188
189 /* For try_to_free_swap() and munlock_vma_page() below */
190 lock_page(old_page);
191
192 mmu_notifier_invalidate_range_start(&range);
193 err = -EAGAIN;
194 if (!page_vma_mapped_walk(&pvmw)) {
195 mem_cgroup_cancel_charge(new_page, memcg, false);
196 goto unlock;
197 }
198 VM_BUG_ON_PAGE(addr != pvmw.address, old_page);
199
200 get_page(new_page);
201 page_add_new_anon_rmap(new_page, vma, addr, false);
202 mem_cgroup_commit_charge(new_page, memcg, false, false);
203 lru_cache_add_active_or_unevictable(new_page, vma);
204
205 if (!PageAnon(old_page)) {
206 dec_mm_counter(mm, mm_counter_file(old_page));
207 inc_mm_counter(mm, MM_ANONPAGES);
208 }
209
210 flush_cache_page(vma, addr, pte_pfn(*pvmw.pte));
211 ptep_clear_flush_notify(vma, addr, pvmw.pte);
212 set_pte_at_notify(mm, addr, pvmw.pte,
213 mk_pte(new_page, vma->vm_page_prot));
214
215 page_remove_rmap(old_page, false);
216 if (!page_mapped(old_page))
217 try_to_free_swap(old_page);
218 page_vma_mapped_walk_done(&pvmw);
219
220 if (vma->vm_flags & VM_LOCKED)
221 munlock_vma_page(old_page);
222 put_page(old_page);
223
224 err = 0;
225 unlock:
226 mmu_notifier_invalidate_range_end(&range);
227 unlock_page(old_page);
228 return err;
229 }
230

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

Attachment: .config.gz
Description: application/gzip