Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 97 11:33:04 -0500
From:      cr@jcmax.com (Cyrus Rahman)
To:        smp@freebsd.org
Subject:   Deadlocking in SMP kernel
Message-ID:  <9704051633.AA05399@corona.jcmax.com>

next in thread | raw e-mail | index | archive | help
There appears to be a situation in which the SMP kernel deadlocks on
mp_lock.  With much help from Steve Passe, I've come up with the following
(still tentative) scenario:

 A process, running on cpu1, enters the kernel and obtains a lock.  While it
 has the lock, but before interrupts are redirected to cpu1 (or any time, if
 TEST_LOPRIO isn't defined), an interrupt goes to cpu0, blocking (until it
 obtains the lock) all lower priority interrupts.

 If for some reason the kernel now waits for an interrupt, there will be a
 deadlock.

Are there any places where the kernel waits for an interrupt to occur?
There are three places I found where software interrupts are generated by
the kernel - but I don't think any of them are relevant (two in icu.s, one
in locore.s).

I suspect that understanding my previous question about why mp_lock needs
to be stored during cpu_switch() might be helpful - for there's clearly some
reason why mp_lock isn't always 1 in that routine, but I can't figure it out.

For some reason the deadlock only seems to occur with APIC_IO defined, if
that provides any additional clues.

Cyrus



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9704051633.AA05399>