diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-10-30 02:15:54 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 05:40:36 +0100 |
commit | 6237bcd94851e9cf0ecd2520d744779df0f5a9a6 (patch) | |
tree | 5f34366cd527382489bd0bebbac8d39d59f1d5db | |
parent | [PATCH] mm: msync_pte_range progress (diff) | |
download | linux-6237bcd94851e9cf0ecd2520d744779df0f5a9a6.tar.xz linux-6237bcd94851e9cf0ecd2520d744779df0f5a9a6.zip |
[PATCH] mm: zap_pte_range dont dirty anon
zap_pte_range already avoids wasting time to mark_page_accessed on anon pages:
it can also skip anon set_page_dirty - the page only needs to be marked dirty
if shared with another mm, but that will say pte_dirty too.
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 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c index 222c13e46130..fd5d4c6dc762 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -574,12 +574,14 @@ static void zap_pte_range(struct mmu_gather *tlb, pmd_t *pmd, addr) != page->index) set_pte_at(tlb->mm, addr, pte, pgoff_to_pte(page->index)); - if (pte_dirty(ptent)) - set_page_dirty(page); if (PageAnon(page)) dec_mm_counter(tlb->mm, anon_rss); - else if (pte_young(ptent)) - mark_page_accessed(page); + else { + if (pte_dirty(ptent)) + set_page_dirty(page); + if (pte_young(ptent)) + mark_page_accessed(page); + } tlb->freed++; page_remove_rmap(page); tlb_remove_page(tlb, page); |