PERFORCE change 58480 for review
John Baldwin
jhb at FreeBSD.org
Thu Jul 29 13:05:15 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=58480
Change 58480 by jhb at jhb_slimer on 2004/07/29 20:04:55
Fix a possible deadlock on SMP by using the same mutex to protect
the pmap_lazyfix IPI + spin as the other TLB IPI + spins.
Affected files ...
.. //depot/projects/smpng/sys/i386/i386/pmap.c#66 edit
Differences ...
==== //depot/projects/smpng/sys/i386/i386/pmap.c#66 (text+ko) ====
@@ -185,9 +185,6 @@
LIST_HEAD(pmaplist, pmap);
static struct pmaplist allpmaps;
static struct mtx allpmaps_lock;
-#ifdef SMP
-static struct mtx lazypmap_lock;
-#endif
vm_paddr_t avail_end; /* PA of last available physical page */
vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */
@@ -332,9 +329,6 @@
kernel_pmap->pm_active = -1; /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvlist);
LIST_INIT(&allpmaps);
-#ifdef SMP
- mtx_init(&lazypmap_lock, "lazypmap", NULL, MTX_SPIN);
-#endif
mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN);
mtx_lock_spin(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, kernel_pmap, pm_list);
@@ -1307,7 +1301,7 @@
while ((mask = pmap->pm_active) != 0) {
spins = 50000000;
mask = mask & -mask; /* Find least significant set bit */
- mtx_lock_spin(&lazypmap_lock);
+ mtx_lock_spin(&smp_tlb_mtx);
#ifdef PAE
lazyptd = vtophys(pmap->pm_pdpt);
#else
@@ -1327,7 +1321,7 @@
break;
}
}
- mtx_unlock_spin(&lazypmap_lock);
+ mtx_unlock_spin(&smp_tlb_mtx);
if (spins == 0)
printf("pmap_lazyfix: spun for 50000000\n");
}
More information about the p4-projects
mailing list