Commit 5bbac23e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] propagate pte reference into page reference during

zap_pte_range() is currently just dropping the pte.  Change it to mark
the page referenced if the pte says it was.  This has the effect of
delaying the eviction of recently-mapped pagecache.

This means that we're currently marking the page accessed when it is
first faulted in as well as when we drop it from pagetables.  Which
matches up with the (strange) behaviour of the VM: it reclaims
PageReferenced pagecache pages off the inactive list.

Probably, it makes sense to remove the mark_page_accessed() from
filemap_nopage() and just use the pte bits everywhere.  Reviewing all
the PageReferenced()/mark_page_accessed() usage is on my todo list.
parent 3a1bfe87
......@@ -355,6 +355,9 @@ static void zap_pte_range(mmu_gather_t *tlb, pmd_t * pmd, unsigned long address,
if (!PageReserved(page)) {
if (pte_dirty(pte))
set_page_dirty(page);
if (page->mapping && pte_young(pte) &&
!PageSwapCache(page))
mark_page_accessed(page);
tlb->freed++;
page_remove_rmap(page, ptep);
tlb_remove_page(tlb, page);
......
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