diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-10-29 21:16:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:39 -0400 |
commit | 86d912f41dca32eca8827f2f878139735e69dc28 (patch) | |
tree | 9f29b853e7690f0fa10c4257a2b8649673908e2d | |
parent | 8c10376271e097fa13cda956e1b2f3cb7e4d4dd9 (diff) |
[PATCH] mm: zap_pte_range dec rss
Small adjustment: zap_pte_range decrement its rss counts from 0 then finally
add, avoiding negations - we don't have or need a sub_mm_rss.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | mm/memory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index 7893eb4bb8c0..bc6296398f8b 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -609,13 +609,13 @@ static void zap_pte_range(struct mmu_gather *tlb, | |||
609 | set_pte_at(mm, addr, pte, | 609 | set_pte_at(mm, addr, pte, |
610 | pgoff_to_pte(page->index)); | 610 | pgoff_to_pte(page->index)); |
611 | if (PageAnon(page)) | 611 | if (PageAnon(page)) |
612 | anon_rss++; | 612 | anon_rss--; |
613 | else { | 613 | else { |
614 | if (pte_dirty(ptent)) | 614 | if (pte_dirty(ptent)) |
615 | set_page_dirty(page); | 615 | set_page_dirty(page); |
616 | if (pte_young(ptent)) | 616 | if (pte_young(ptent)) |
617 | mark_page_accessed(page); | 617 | mark_page_accessed(page); |
618 | file_rss++; | 618 | file_rss--; |
619 | } | 619 | } |
620 | page_remove_rmap(page); | 620 | page_remove_rmap(page); |
621 | tlb_remove_page(tlb, page); | 621 | tlb_remove_page(tlb, page); |
@@ -632,7 +632,7 @@ static void zap_pte_range(struct mmu_gather *tlb, | |||
632 | pte_clear_full(mm, addr, pte, tlb->fullmm); | 632 | pte_clear_full(mm, addr, pte, tlb->fullmm); |
633 | } while (pte++, addr += PAGE_SIZE, addr != end); | 633 | } while (pte++, addr += PAGE_SIZE, addr != end); |
634 | 634 | ||
635 | add_mm_rss(mm, -file_rss, -anon_rss); | 635 | add_mm_rss(mm, file_rss, anon_rss); |
636 | pte_unmap(pte - 1); | 636 | pte_unmap(pte - 1); |
637 | } | 637 | } |
638 | 638 | ||