Commit 86d912f4 authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[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: 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 8c103762
...@@ -609,13 +609,13 @@ static void zap_pte_range(struct mmu_gather *tlb, ...@@ -609,13 +609,13 @@ static void zap_pte_range(struct mmu_gather *tlb,
set_pte_at(mm, addr, pte, set_pte_at(mm, addr, pte,
pgoff_to_pte(page->index)); pgoff_to_pte(page->index));
if (PageAnon(page)) if (PageAnon(page))
anon_rss++; anon_rss--;
else { else {
if (pte_dirty(ptent)) if (pte_dirty(ptent))
set_page_dirty(page); set_page_dirty(page);
if (pte_young(ptent)) if (pte_young(ptent))
mark_page_accessed(page); mark_page_accessed(page);
file_rss++; file_rss--;
} }
page_remove_rmap(page); page_remove_rmap(page);
tlb_remove_page(tlb, page); tlb_remove_page(tlb, page);
...@@ -632,7 +632,7 @@ static void zap_pte_range(struct mmu_gather *tlb, ...@@ -632,7 +632,7 @@ static void zap_pte_range(struct mmu_gather *tlb,
pte_clear_full(mm, addr, pte, tlb->fullmm); pte_clear_full(mm, addr, pte, tlb->fullmm);
} while (pte++, addr += PAGE_SIZE, addr != end); } while (pte++, addr += PAGE_SIZE, addr != end);
add_mm_rss(mm, -file_rss, -anon_rss); add_mm_rss(mm, file_rss, anon_rss);
pte_unmap(pte - 1); pte_unmap(pte - 1);
} }
......
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