Linux PARISC architecture development
 help / color / mirror / Atom feed
* [PATCH, RFC] fix parisc runtime hangs wrt pa_tlb_lock
@ 2009-05-22 20:13 Helge Deller
  2009-05-23 15:26 ` John David Anglin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Helge Deller @ 2009-05-22 20:13 UTC (permalink / raw)
  To: linux-parisc, John David Anglin

Since many kernel versions I regularly faced reproducibly kernel hangs when
compiling some bigger files. The machine suddenly just seemed to hang.

With spinlock debugging turned on I found this:

BUG: spinlock recursion on CPU#0, tool/7263
 lock: 10644000, .magic: dead4ead, .owner: tool/7263, .owner_cpu: 0
Backtrace:
 [<10113a94>] show_stack+0x18/0x28

BUG: spinlock lockup on CPU#0, tool/7263, 10644000
Backtrace:
 [<10113a94>] show_stack+0x18/0x28

BUG: soft lockup - CPU#0 stuck for 61s! [tool:7263]
IASQ: 00000000 00000000 IAOQ: 102d55dc 102d557c
 IIR: 03c008b3    ISR: 00000000  IOR: 00000000
 CPU:        0   CR30: 7d1a4000 CR31: 11111111
 ORIG_R28: 00000000
 IAOQ[0]: _raw_spin_lock+0x15c/0x1c0
 IAOQ[1]: _raw_spin_lock+0xfc/0x1c0
 RP(r2): _raw_spin_lock+0x18c/0x1c0
Backtrace:
 [<102d560c>] _raw_spin_lock+0x18c/0x1c0

Kernel panic - not syncing: softlockup: hung tasks
Backtrace:
 [<10113a94>] show_stack+0x18/0x28


The lock at "10644000" references pa_tlb_lock, which is used to lock the PxTLB 
broadcasts (see comment in cache.c).

So, I think we need to use the irq-blocking functions for purge_tlb_start() and
purge_tlb_end(). I did tested the patch below, and since then I didn't faced one
single hang any longer. 

The patch below is just a hack. It will need a cleanup and is just to open
discussions here on the list.

Helge

diff --git a/arch/parisc/include/asm/tlbflush.h b/arch/parisc/include/asm/tlbflush.h
index 1f6fd4f..9b92fbe 100644
--- a/arch/parisc/include/asm/tlbflush.h
+++ b/arch/parisc/include/asm/tlbflush.h
@@ -18,8 +18,8 @@
  */
 extern spinlock_t pa_tlb_lock;
 
-#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
-#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
+#define purge_tlb_start(x)	do { unsigned long flags; spin_lock_irqsave(&pa_tlb_lock, flags)
+#define purge_tlb_end(x)	     spin_unlock_irqrestore(&pa_tlb_lock, flags); } while (0)
 
 extern void flush_tlb_all(void);
 extern void flush_tlb_all_local(void *);

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

end of thread, other threads:[~2009-06-17  7:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 20:13 [PATCH, RFC] fix parisc runtime hangs wrt pa_tlb_lock Helge Deller
2009-05-23 15:26 ` John David Anglin
2009-05-23 15:34   ` John David Anglin
2009-05-23 19:34     ` Helge Deller
2009-05-23 20:03       ` John David Anglin
2009-05-23 21:53 ` John David Anglin
2009-05-28  1:50 ` John David Anglin
2009-06-06 21:25   ` Helge Deller
2009-06-14 22:05     ` Helge Deller
2009-06-14 23:20       ` John David Anglin
2009-06-16 20:51         ` [PATCH] " Helge Deller
2009-06-17  2:55           ` Kyle McMartin
2009-06-17  7:26             ` Helge Deller

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