lkml.org 
[lkml]   [2004]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] rmap 24 pte_young first
From: Andrea Arcangeli <andrea@suse.de>

rmap test pte_young before doing the costlier ptep_test_and_clear_young.

rmap.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

--- rmap24/mm/rmap.c 2004-05-08 20:54:32.421571016 +0100
+++ rmap25/mm/rmap.c 2004-05-08 20:54:43.358908288 +0100
@@ -198,7 +198,7 @@ static int page_referenced_one(struct pa
if (page_to_pfn(page) != pte_pfn(*pte))
goto out_unmap;

- if (ptep_test_and_clear_young(pte))
+ if (pte_young(*pte) && ptep_test_and_clear_young(pte))
referenced++;

(*mapcount)--;
@@ -506,7 +506,7 @@ static int try_to_unmap_one(struct page
* skipped over this mm) then we should reactivate it.
*/
if ((vma->vm_flags & (VM_LOCKED|VM_RESERVED)) ||
- ptep_test_and_clear_young(pte)) {
+ (pte_young(*pte) && ptep_test_and_clear_young(pte))) {
ret = SWAP_FAIL;
goto out_unmap;
}
@@ -606,7 +606,7 @@ static int try_to_unmap_cluster(struct m
if (PageReserved(page))
continue;

- if (ptep_test_and_clear_young(pte))
+ if (pte_young(*pte) && ptep_test_and_clear_young(pte))
continue;

/* Nuke the page table entry. */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.071 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site