提交 6237bcd9 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

[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: NHugh Dickins <hugh@veritas.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 0c942a45
...@@ -574,12 +574,14 @@ static void zap_pte_range(struct mmu_gather *tlb, pmd_t *pmd, ...@@ -574,12 +574,14 @@ static void zap_pte_range(struct mmu_gather *tlb, pmd_t *pmd,
addr) != page->index) addr) != page->index)
set_pte_at(tlb->mm, addr, pte, set_pte_at(tlb->mm, addr, pte,
pgoff_to_pte(page->index)); pgoff_to_pte(page->index));
if (pte_dirty(ptent))
set_page_dirty(page);
if (PageAnon(page)) if (PageAnon(page))
dec_mm_counter(tlb->mm, anon_rss); dec_mm_counter(tlb->mm, anon_rss);
else if (pte_young(ptent)) else {
if (pte_dirty(ptent))
set_page_dirty(page);
if (pte_young(ptent))
mark_page_accessed(page); mark_page_accessed(page);
}
tlb->freed++; tlb->freed++;
page_remove_rmap(page); page_remove_rmap(page);
tlb_remove_page(tlb, page); tlb_remove_page(tlb, page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册