Re: spin_unlock optimization(i386)

Andrea Arcangeli (andrea@suse.de)
Fri, 26 Nov 1999 20:44:46 +0100 (CET)


On Fri, 26 Nov 1999, Andrea Arcangeli wrote:

>I think as last try before giving up with this issue (for now) I'll make
>all userspace memory as uncached (forcing the PCD bit in mk_pte()) and
>I'll try Manfred's testcase this way. It should work on UC memory even
>without the lock if it's correct.

It's impressive how slow the machine is with the cache turned off, it
took 3/4 minutes between init and the login prompt (compared to the
previous 10/20 sec)...

movopt2.cpp works fine with the cache turned off while it fails with the
cache turned on. But there's to say that the timing could be different
with the cache turned on. Usually it hangs at 300 here and with UC at 500
was still fine (it took a long time to reach 500).

If somebody want to play with the cache turned off I enclose here the
patch I did:

diff -urN 2.2.14pre7/include/asm-i386/pgtable.h UC/include/asm-i386/pgtable.h
--- 2.2.14pre7/include/asm-i386/pgtable.h Sun Nov 7 17:27:27 1999
+++ UC/include/asm-i386/pgtable.h Fri Nov 26 20:01:33 1999
@@ -356,11 +356,11 @@
* and a page entry and page directory to the page they refer to.
*/
#define mk_pte(page, pgprot) \
-({ pte_t __pte; pte_val(__pte) = __pa(page) + pgprot_val(pgprot); __pte; })
+({ pte_t __pte; pte_val(__pte) = __pa(page) + pgprot_val(pgprot) + _PAGE_PCD; __pte; })

/* This takes a physical page address that is used by the remapping functions */
#define mk_pte_phys(physpage, pgprot) \
-({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
+({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot) + _PAGE_PCD; __pte; })

extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }

Andrea

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