Module Name:    src
Committed By:   mhitch
Date:           Mon Nov  9 04:31:03 UTC 2009

Modified Files:
        src/sys/arch/alpha/alpha: pmap.c

Log Message:
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-amiga/38335 and PR port-amiga/42174.


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 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.249 src/sys/arch/alpha/alpha/pmap.c:1.250
--- src/sys/arch/alpha/alpha/pmap.c:1.249	Sat Nov  7 07:27:40 2009
+++ src/sys/arch/alpha/alpha/pmap.c	Mon Nov  9 04:31:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.249 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.250 2009/11/09 04:31:03 mhitch 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.249 2009/11/07 07:27:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.250 2009/11/09 04:31:03 mhitch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3581,6 +3581,7 @@
 		cpumask |= 1UL << ci->ci_cpuid;
 
 		pq = &pmap_tlb_shootdown_q[ci->ci_cpuid];
+		mutex_spin_enter(&pq->pq_lock);
 
 		/*
 		 * Allocate a job.
@@ -3596,7 +3597,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