mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] mm: more rmap debugging
Add more debugging in the rmap code in an attempt to locate to source of the occasional "mapcount went negative" assertions. Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
19900cdee2
commit
7de6b80579
5 changed files with 15 additions and 8 deletions
13
mm/rmap.c
13
mm/rmap.c
|
|
@ -47,6 +47,7 @@
|
|||
#include <linux/rmap.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kallsyms.h>
|
||||
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
|
|
@ -567,14 +568,20 @@ void page_add_file_rmap(struct page *page)
|
|||
*
|
||||
* The caller needs to hold the pte lock.
|
||||
*/
|
||||
void page_remove_rmap(struct page *page)
|
||||
void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
|
||||
{
|
||||
if (atomic_add_negative(-1, &page->_mapcount)) {
|
||||
if (unlikely(page_mapcount(page) < 0)) {
|
||||
printk (KERN_EMERG "Eeek! page_mapcount(page) went negative! (%d)\n", page_mapcount(page));
|
||||
printk (KERN_EMERG " page pfn = %lx\n", page_to_pfn(page));
|
||||
printk (KERN_EMERG " page->flags = %lx\n", page->flags);
|
||||
printk (KERN_EMERG " page->count = %x\n", page_count(page));
|
||||
printk (KERN_EMERG " page->mapping = %p\n", page->mapping);
|
||||
print_symbol (KERN_EMERG " vma->vm_ops = %s\n", (unsigned long)vma->vm_ops);
|
||||
if (vma->vm_ops)
|
||||
print_symbol (KERN_EMERG " vma->vm_ops->nopage = %s\n", (unsigned long)vma->vm_ops->nopage);
|
||||
if (vma->vm_file && vma->vm_file->f_op)
|
||||
print_symbol (KERN_EMERG " vma->vm_file->f_op->mmap = %s\n", (unsigned long)vma->vm_file->f_op->mmap);
|
||||
BUG();
|
||||
}
|
||||
|
||||
|
|
@ -679,7 +686,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
|
|||
dec_mm_counter(mm, file_rss);
|
||||
|
||||
|
||||
page_remove_rmap(page);
|
||||
page_remove_rmap(page, vma);
|
||||
page_cache_release(page);
|
||||
|
||||
out_unmap:
|
||||
|
|
@ -769,7 +776,7 @@ static void try_to_unmap_cluster(unsigned long cursor,
|
|||
if (pte_dirty(pteval))
|
||||
set_page_dirty(page);
|
||||
|
||||
page_remove_rmap(page);
|
||||
page_remove_rmap(page, vma);
|
||||
page_cache_release(page);
|
||||
dec_mm_counter(mm, file_rss);
|
||||
(*mapcount)--;
|
||||
|
|
|
|||
Loading…
Reference in a new issue