From owner-p4-projects@FreeBSD.ORG Thu Jul 29 20:05:15 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1504416A4D0; Thu, 29 Jul 2004 20:05:15 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDA1E16A4D1 for ; Thu, 29 Jul 2004 20:05:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C457C43D60 for ; Thu, 29 Jul 2004 20:05:14 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i6TK5EwC053599 for ; Thu, 29 Jul 2004 20:05:14 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6TK5EWE053596 for perforce@freebsd.org; Thu, 29 Jul 2004 20:05:14 GMT (envelope-from jhb@freebsd.org) Date: Thu, 29 Jul 2004 20:05:14 GMT Message-Id: <200407292005.i6TK5EWE053596@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 58480 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 20:05:15 -0000 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"); }