Module Name:    src
Committed By:   snj
Date:           Sun Nov 15 05:54:38 UTC 2009

Modified Files:
        src/sys/arch/alpha/alpha [netbsd-5]: pmap.c

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #1137):
        sys/arch/alpha/alpha/pmap.c: revision 1.250
The tlb shootdown IPI can interrupt the pool_cache_get() in places that
can cause a deadlock or pool cache corruption.  Take the shootdown job
queue mutex before calling pool_cache_get(), which will block the IPI
interrupts and seems to fix the remaining tlb shootdown deadlocks and
pool cache corruption I've been seeing.  Should address both
PR port-alpha/38335 and PR port-alpha/42174.


To generate a diff of this commit:
cvs rdiff -u -r1.236.10.3 -r1.236.10.4 src/sys/arch/alpha/alpha/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.236.10.3 src/sys/arch/alpha/alpha/pmap.c:1.236.10.4
--- src/sys/arch/alpha/alpha/pmap.c:1.236.10.3	Fri Oct 16 06:42:53 2009
+++ src/sys/arch/alpha/alpha/pmap.c	Sun Nov 15 05:54:38 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.236.10.3 2009/10/16 06:42:53 snj Exp $ */
+/* $NetBSD: pmap.c,v 1.236.10.4 2009/11/15 05:54:38 snj Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.236.10.3 2009/10/16 06:42:53 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.236.10.4 2009/11/15 05:54:38 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3684,6 +3684,7 @@
 		cpumask |= 1UL << ci->ci_cpuid;
 
 		pq = &pmap_tlb_shootdown_q[ci->ci_cpuid];
+		mutex_spin_enter(&pq->pq_lock);
 
 		/*
 		 * Allocate a job.
@@ -3699,7 +3700,6 @@
 		 * If a global flush is already pending, we
 		 * don't really have to do anything else.
 		 */
-		mutex_spin_enter(&pq->pq_lock);
 		pq->pq_pte |= pte;
 		if (pq->pq_tbia) {
 			mutex_spin_exit(&pq->pq_lock);

Reply via email to