Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 11/20/2000 22:17:14
Module Name:	syssrc
Committed By:	thorpej
Date:		Mon Nov 20 20:17:14 UTC 2000

Modified Files:
	syssrc/sys/arch/alpha/include: lock.h

Log Message:
On the Alpha, interprocessor interrupts come in at the same priority
as normal device interrupts.  Because of this, we won't get IPIs while
servicing such interrupts.  This can lead to the following deadlock
scenario as reported by Bill Sommerfeld:
- Process runs on cpu1, but has FP state on cpu0.
- Process executes FP-using insn, causing an FP trap, which causes
  the kernel lock to be acquired.
- At roughly the same time, cpu0 receives a device interrupt, and attempts
  to acquire the kernel lock, which blocks since cpu1 already has it.
- cpu1 sends cpu0 a SYNCH FPU IPI, and waits for cpu0 to release its
  FP state.
- Since cpu0 cannot notice the IPI until it has processed the device
  interrupt, which it cannot do because it cannot acquire the kernel
  lock, we have deadlock.

Solve the problem by adding a spinlock interlock release hook which
checks for pending IPIs and processes them.

Idea from Bill Sommerfeld.


To generate a diff of this commit:
cvs rdiff -r1.10 -r1.11 syssrc/sys/arch/alpha/include/lock.h

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