Subject: Re: pmap_zero_page() and TLB
To: Jason R Thorpe <thorpej@zembu.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-i386
Date: 10/06/2000 21:23:28
--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
On Thu, Oct 05, 2000 at 04:41:53PM -0700, Jason R Thorpe wrote:
> Folks...
>
> So, I just heard for the first time today that some people hare having
> K6 issues wrt. zero page idling -- wasn't aware of that. So, this goes
> back to the problems we saw with the Cyrix CPUs. I think the way the
> pmap is doing TLB invalidation is a little sketchy.
>
> I've attached a diff that I'd like people with Cyrix CPUs to try. It's
> relative to the 1.5 branch. Please see if this works in the presence
> of idle page zero'ing.
I tried it in -current (diff attached, I think I got it rigth), I seems to
have solved the panic on my:
NetBSD 1.5G (ROCHA) #0: Fri Oct 6 20:54:35 MEST 2000
bouyer@rocha.antioche.eu.org:/home/bouyer/1.5F/arch/i386/compile/ROCHA
cpu0: Cyrix 6x86 (486-class)
total memory = 65148 KB
avail memory = 39196 KB
I compiled a kernel without problems; before pmap_zero_page_uncached() was
dissabled on cyrix it would no compile a kernel without one or 2 panics.
--
Manuel Bouyer <bouyer@antioche.eu.org>
--
--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
--- pmap.c.orig Fri Sep 29 16:04:21 2000
+++ pmap.c Fri Oct 6 20:20:31 2000
@@ -2109,16 +2109,11 @@
pmap_zero_page(pa)
paddr_t pa;
{
- simple_lock(&pmap_zero_page_lock);
-#ifdef DIAGNOSTIC
- if (*zero_pte)
- panic("pmap_zero_page: lock botch");
-#endif
+ simple_lock(&pmap_zero_page_lock);
*zero_pte = (pa & PG_FRAME) | PG_V | PG_RW; /* map in */
+ pmap_update_pg((vaddr_t)zerop); /* flush TLB */
memset(zerop, 0, NBPG); /* zero */
- *zero_pte = 0; /* zap! */
- pmap_update_pg((vaddr_t)zerop); /* flush TLB */
simple_unlock(&pmap_zero_page_lock);
}
@@ -2136,13 +2131,10 @@
int i, *ptr;
simple_lock(&pmap_zero_page_lock);
-#ifdef DIAGNOSTIC
- if (*zero_pte)
- panic("pmap_zero_page_uncached: lock botch");
-#endif
*zero_pte = (pa & PG_FRAME) | PG_V | PG_RW | /* map in */
((cpu_class != CPUCLASS_386) ? PG_N : 0);
+ pmap_update_pg((vaddr_t)zerop); /* flush TLB */
for (i = 0, ptr = (int *) zerop; i < NBPG / sizeof(int); i++) {
if (sched_whichqs != 0) {
/*
@@ -2156,8 +2148,6 @@
}
*ptr++ = 0;
}
- *zero_pte = 0; /* zap! */
- pmap_update_pg((vaddr_t)zerop); /* flush TLB */
simple_unlock(&pmap_zero_page_lock);
return (rv);
--- machdep.c.orig Fri Sep 29 16:52:24 2000
+++ machdep.c Fri Oct 6 20:10:42 2000
@@ -796,7 +796,7 @@
* XXX disable page zero in the idle loop, it seems to
* cause panics on these CPUs.
*/
- vm_page_zero_enable = FALSE;
+ vm_page_zero_enable = TRUE;
}
void
--liOOAslEiF7prFVr--