[PATCH] - ia64_ctx.lock deadlock

From: Jack Steiner <steiner_at_sgi.com>
Date: 2003-12-28 01:27:22
I hit a deadlock involving the ia64_ctx.lock. The lock
may be taken in interrupt context to process an IPI from smp_flush_tlb_mm.

Here is a patch:


--- linux_base/include/asm-ia64/mmu_context.h	Fri Dec 26 11:06:35 2003
+++ linux/include/asm-ia64/mmu_context.h	Sat Dec 27 08:19:35 2003
@@ -95,12 +95,13 @@
 static inline mm_context_t
 get_mmu_context (struct mm_struct *mm)
 {
+	unsigned long flags;
 	mm_context_t context = mm->context;
 
 	if (context)
 		return context;
 
-	spin_lock(&ia64_ctx.lock);
+	spin_lock_irqsave(&ia64_ctx.lock, flags);
 	{
 		/* re-check, now that we've got the lock: */
 		context = mm->context;
@@ -110,7 +111,7 @@
 			mm->context = context = ia64_ctx.next++;
 		}
 	}
-	spin_unlock(&ia64_ctx.lock);
+	spin_unlock_irqrestore(&ia64_ctx.lock, flags);
 	return context;
 }
 
-- 
Thanks

Jack Steiner (steiner@sgi.com)          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.


-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Dec 27 09:32:05 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:21 EST