public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - ia64_ctx.lock deadlock
@ 2003-12-27 14:27 Jack Steiner
  2003-12-29 20:23 ` David Mosberger
  2003-12-29 22:31 ` Matthew Wilcox
  0 siblings, 2 replies; 3+ messages in thread
From: Jack Steiner @ 2003-12-27 14:27 UTC (permalink / raw)
  To: linux-ia64

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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - ia64_ctx.lock deadlock
  2003-12-27 14:27 [PATCH] - ia64_ctx.lock deadlock Jack Steiner
@ 2003-12-29 20:23 ` David Mosberger
  2003-12-29 22:31 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2003-12-29 20:23 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sat, 27 Dec 2003 08:27:22 -0600, Jack Steiner <steiner@sgi.com> said:

  Jack> I hit a deadlock involving the ia64_ctx.lock. The lock may be
  Jack> taken in interrupt context to process an IPI from
  Jack> smp_flush_tlb_mm.

The patch looks correct to me.

Thanks,

	--david

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - ia64_ctx.lock deadlock
  2003-12-27 14:27 [PATCH] - ia64_ctx.lock deadlock Jack Steiner
  2003-12-29 20:23 ` David Mosberger
@ 2003-12-29 22:31 ` Matthew Wilcox
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2003-12-29 22:31 UTC (permalink / raw)
  To: linux-ia64

On Sat, Dec 27, 2003 at 08:27:22AM -0600, Jack Steiner wrote:
> 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:
> -	spin_lock(&ia64_ctx.lock);
> +	spin_lock_irqsave(&ia64_ctx.lock, flags);

Would it be better to use spin_lock_irq() / spin_unlock_irq() here?
It seems to me this function is only called from task context.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-29 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-27 14:27 [PATCH] - ia64_ctx.lock deadlock Jack Steiner
2003-12-29 20:23 ` David Mosberger
2003-12-29 22:31 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox