diff options
author | Hugh Dickins <hugh@veritas.com> | 2009-01-06 17:40:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:07 -0500 |
commit | edc315fd222497ae4f4b959a9e31ada1e68a4755 (patch) | |
tree | aaf1a6b015368c52097ed0c362a24bf18e40897f /mm/rmap.c | |
parent | 2509ef26db4699a5d9fa876e90ddfc107afcab84 (diff) |
badpage: remove vma from page_remove_rmap
Remove page_remove_rmap()'s vma arg, which was only for the Eeek message.
And remove the BUG_ON(page_mapcount(page) == 0) from CONFIG_DEBUG_VM's
page_dup_rmap(): we're trying to be more resilient about that than BUGs.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -707,7 +707,6 @@ void page_add_file_rmap(struct page *page) | |||
707 | */ | 707 | */ |
708 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) | 708 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) |
709 | { | 709 | { |
710 | BUG_ON(page_mapcount(page) == 0); | ||
711 | if (PageAnon(page)) | 710 | if (PageAnon(page)) |
712 | __page_check_anon_rmap(page, vma, address); | 711 | __page_check_anon_rmap(page, vma, address); |
713 | atomic_inc(&page->_mapcount); | 712 | atomic_inc(&page->_mapcount); |
@@ -717,11 +716,10 @@ void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long | |||
717 | /** | 716 | /** |
718 | * page_remove_rmap - take down pte mapping from a page | 717 | * page_remove_rmap - take down pte mapping from a page |
719 | * @page: page to remove mapping from | 718 | * @page: page to remove mapping from |
720 | * @vma: the vm area in which the mapping is removed | ||
721 | * | 719 | * |
722 | * The caller needs to hold the pte lock. | 720 | * The caller needs to hold the pte lock. |
723 | */ | 721 | */ |
724 | void page_remove_rmap(struct page *page, struct vm_area_struct *vma) | 722 | void page_remove_rmap(struct page *page) |
725 | { | 723 | { |
726 | if (atomic_add_negative(-1, &page->_mapcount)) { | 724 | if (atomic_add_negative(-1, &page->_mapcount)) { |
727 | /* | 725 | /* |
@@ -837,7 +835,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma, | |||
837 | dec_mm_counter(mm, file_rss); | 835 | dec_mm_counter(mm, file_rss); |
838 | 836 | ||
839 | 837 | ||
840 | page_remove_rmap(page, vma); | 838 | page_remove_rmap(page); |
841 | page_cache_release(page); | 839 | page_cache_release(page); |
842 | 840 | ||
843 | out_unmap: | 841 | out_unmap: |
@@ -952,7 +950,7 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, | |||
952 | if (pte_dirty(pteval)) | 950 | if (pte_dirty(pteval)) |
953 | set_page_dirty(page); | 951 | set_page_dirty(page); |
954 | 952 | ||
955 | page_remove_rmap(page, vma); | 953 | page_remove_rmap(page); |
956 | page_cache_release(page); | 954 | page_cache_release(page); |
957 | dec_mm_counter(mm, file_rss); | 955 | dec_mm_counter(mm, file_rss); |
958 | (*mapcount)--; | 956 | (*mapcount)--; |