Commit 1d90ac58 authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[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: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ebd6867f
...@@ -193,7 +193,7 @@ vma_address(struct page *page, struct vm_area_struct *vma) ...@@ -193,7 +193,7 @@ vma_address(struct page *page, struct vm_area_struct *vma)
* repeatedly from either page_referenced_anon or page_referenced_file. * repeatedly from either page_referenced_anon or page_referenced_file.
*/ */
static int page_referenced_one(struct page *page, static int page_referenced_one(struct page *page,
struct vm_area_struct *vma, unsigned int *mapcount, int *failed) struct vm_area_struct *vma, unsigned int *mapcount)
{ {
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
unsigned long address; unsigned long address;
...@@ -208,14 +208,8 @@ static int page_referenced_one(struct page *page, ...@@ -208,14 +208,8 @@ static int page_referenced_one(struct page *page,
if (address == -EFAULT) if (address == -EFAULT)
goto out; goto out;
if (!spin_trylock(&mm->page_table_lock)) { if (!spin_trylock(&mm->page_table_lock))
/*
* For debug we're currently warning if not all found,
* but in this case that's expected: suppress warning.
*/
(*failed)++;
goto out; goto out;
}
pgd = pgd_offset(mm, address); pgd = pgd_offset(mm, address);
if (!pgd_present(*pgd)) if (!pgd_present(*pgd))
...@@ -251,18 +245,14 @@ static inline int page_referenced_anon(struct page *page) ...@@ -251,18 +245,14 @@ static inline int page_referenced_anon(struct page *page)
struct anon_vma *anon_vma = (struct anon_vma *) page->mapping; struct anon_vma *anon_vma = (struct anon_vma *) page->mapping;
struct vm_area_struct *vma; struct vm_area_struct *vma;
int referenced = 0; int referenced = 0;
int failed = 0;
spin_lock(&anon_vma->lock); spin_lock(&anon_vma->lock);
BUG_ON(list_empty(&anon_vma->head)); BUG_ON(list_empty(&anon_vma->head));
list_for_each_entry(vma, &anon_vma->head, anon_vma_node) { list_for_each_entry(vma, &anon_vma->head, anon_vma_node) {
referenced += page_referenced_one(page, vma, referenced += page_referenced_one(page, vma, &mapcount);
&mapcount, &failed);
if (!mapcount) if (!mapcount)
goto out; break;
} }
WARN_ON(!failed);
out:
spin_unlock(&anon_vma->lock); spin_unlock(&anon_vma->lock);
return referenced; return referenced;
} }
...@@ -289,7 +279,6 @@ static inline int page_referenced_file(struct page *page) ...@@ -289,7 +279,6 @@ static inline int page_referenced_file(struct page *page)
struct vm_area_struct *vma = NULL; struct vm_area_struct *vma = NULL;
struct prio_tree_iter iter; struct prio_tree_iter iter;
int referenced = 0; int referenced = 0;
int failed = 0;
if (!spin_trylock(&mapping->i_mmap_lock)) if (!spin_trylock(&mapping->i_mmap_lock))
return 0; return 0;
...@@ -299,17 +288,13 @@ static inline int page_referenced_file(struct page *page) ...@@ -299,17 +288,13 @@ static inline int page_referenced_file(struct page *page)
if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE)) if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE))
== (VM_LOCKED|VM_MAYSHARE)) { == (VM_LOCKED|VM_MAYSHARE)) {
referenced++; referenced++;
goto out; break;
} }
referenced += page_referenced_one(page, vma, referenced += page_referenced_one(page, vma, &mapcount);
&mapcount, &failed);
if (!mapcount) if (!mapcount)
goto out; break;
} }
if (list_empty(&mapping->i_mmap_nonlinear))
WARN_ON(!failed);
out:
spin_unlock(&mapping->i_mmap_lock); spin_unlock(&mapping->i_mmap_lock);
return referenced; return referenced;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment