aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 53c56dacd725..f01e92244c53 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -360,8 +360,17 @@ static int page_referenced_one(struct page *page,
360 goto out_unmap; 360 goto out_unmap;
361 } 361 }
362 362
363 if (ptep_clear_flush_young_notify(vma, address, pte)) 363 if (ptep_clear_flush_young_notify(vma, address, pte)) {
364 referenced++; 364 /*
365 * Don't treat a reference through a sequentially read
366 * mapping as such. If the page has been used in
367 * another mapping, we will catch it; if this other
368 * mapping is already gone, the unmap path will have
369 * set PG_referenced or activated the page.
370 */
371 if (likely(!VM_SequentialReadHint(vma)))
372 referenced++;
373 }
365 374
366 /* Pretend the page is referenced if the task has the 375 /* Pretend the page is referenced if the task has the
367 swap token and is in the middle of a page fault. */ 376 swap token and is in the middle of a page fault. */