Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2004 20:05:14 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 58480 for review
Message-ID:  <200407292005.i6TK5EWE053596@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=58480

Change 58480 by jhb@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");
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407292005.i6TK5EWE053596>