Skip to content

Commit 1d90ac5

Browse files
Hugh DickinsLinus Torvalds
authored andcommitted
[PATCH] mm: kill missed pte warning
I've seen no warnings, nor heard any reports of warnings, that anon_vma ever misses ptes (nor anonmm before it). That WARN_ON (with its useless stack dump) was okay to goad developers into making reports, but would mainly be an irritation if it ever appears on user systems: kill it now. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent ebd6867 commit 1d90ac5

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

mm/rmap.c

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ vma_address(struct page *page, struct vm_area_struct *vma)
193193
* repeatedly from either page_referenced_anon or page_referenced_file.
194194
*/
195195
static int page_referenced_one(struct page *page,
196-
struct vm_area_struct *vma, unsigned int *mapcount, int *failed)
196+
struct vm_area_struct *vma, unsigned int *mapcount)
197197
{
198198
struct mm_struct *mm = vma->vm_mm;
199199
unsigned long address;
@@ -208,14 +208,8 @@ static int page_referenced_one(struct page *page,
208208
if (address == -EFAULT)
209209
goto out;
210210

211-
if (!spin_trylock(&mm->page_table_lock)) {
212-
/*
213-
* For debug we're currently warning if not all found,
214-
* but in this case that's expected: suppress warning.
215-
*/
216-
(*failed)++;
211+
if (!spin_trylock(&mm->page_table_lock))
217212
goto out;
218-
}
219213

220214
pgd = pgd_offset(mm, address);
221215
if (!pgd_present(*pgd))
@@ -251,18 +245,14 @@ static inline int page_referenced_anon(struct page *page)
251245
struct anon_vma *anon_vma = (struct anon_vma *) page->mapping;
252246
struct vm_area_struct *vma;
253247
int referenced = 0;
254-
int failed = 0;
255248

256249
spin_lock(&anon_vma->lock);
257250
BUG_ON(list_empty(&anon_vma->head));
258251
list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
259-
referenced += page_referenced_one(page, vma,
260-
&mapcount, &failed);
252+
referenced += page_referenced_one(page, vma, &mapcount);
261253
if (!mapcount)
262-
goto out;
254+
break;
263255
}
264-
WARN_ON(!failed);
265-
out:
266256
spin_unlock(&anon_vma->lock);
267257
return referenced;
268258
}
@@ -289,7 +279,6 @@ static inline int page_referenced_file(struct page *page)
289279
struct vm_area_struct *vma = NULL;
290280
struct prio_tree_iter iter;
291281
int referenced = 0;
292-
int failed = 0;
293282

294283
if (!spin_trylock(&mapping->i_mmap_lock))
295284
return 0;
@@ -299,17 +288,13 @@ static inline int page_referenced_file(struct page *page)
299288
if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE))
300289
== (VM_LOCKED|VM_MAYSHARE)) {
301290
referenced++;
302-
goto out;
291+
break;
303292
}
304-
referenced += page_referenced_one(page, vma,
305-
&mapcount, &failed);
293+
referenced += page_referenced_one(page, vma, &mapcount);
306294
if (!mapcount)
307-
goto out;
295+
break;
308296
}
309297

310-
if (list_empty(&mapping->i_mmap_nonlinear))
311-
WARN_ON(!failed);
312-
out:
313298
spin_unlock(&mapping->i_mmap_lock);
314299
return referenced;
315300
}

0 commit comments

Comments
 (0)