Re: [PATCH] rmap 24 pte_young first

From: Christoph Hellwig
Date: Sat May 08 2004 - 17:24:43 EST


On Sat, May 08, 2004 at 10:56:26PM +0100, Hugh Dickins wrote:
> From: Andrea Arcangeli <andrea@xxxxxxx>
>
> 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))

stupid question - shouldn't the pte_young check simply move to
the beginning of ptep_test_and_clear_young?

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