adjust prefetch in free_one_pgd()

From: David Mosberger (davidm@napali.hpl.hp.com)
Date: Thu Aug 01 2002 - 19:12:39 EST


As per an earlier discussion on the lkml, the existing prefetch in
free_one_pgd() is somewhat broken in that it prefetches further than
PREFETCH_STRIDE bytes. The patch below fixes that. I'm told that
this also performs better on x86 (it makes little difference on ia64,
but it is also marginally better).

        --david

diff -Nru a/mm/memory.c b/mm/memory.c
--- a/mm/memory.c Thu Aug 1 17:02:14 2002
+++ b/mm/memory.c Thu Aug 1 17:02:14 2002
@@ -110,7 +110,7 @@
         pmd = pmd_offset(dir, 0);
         pgd_clear(dir);
         for (j = 0; j < PTRS_PER_PMD ; j++) {
- prefetchw(pmd+j+(PREFETCH_STRIDE/16));
+ prefetchw(pmd + j + PREFETCH_STRIDE/sizeof(*pmd));
                 free_one_pmd(tlb, pmd+j);
         }
         pmd_free_tlb(tlb, pmd);
-
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/



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:17 EST