9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] apic fail
@ 2010-07-19 20:14 Richard Miller
  2010-07-19 21:25 ` Charles Forsyth
  2010-07-20  8:54 ` Richard Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Miller @ 2010-07-19 20:14 UTC (permalink / raw)
  To: 9fans

The change to /sys/src/9/pc/apic.c made on 13 July makes my system
(dual-processor atom) crash soon after the ethernet (rtl8169) is
enabled.  Symptom: either a silent hang, or "panic: freeb: ref -1"
called from etheriq (simultaneously on both cpus).

Is one interrupt being dispatched to two cpus, I wonder?




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

* Re: [9fans] apic fail
  2010-07-19 20:14 [9fans] apic fail Richard Miller
@ 2010-07-19 21:25 ` Charles Forsyth
  2010-07-19 21:55   ` erik quanstrom
  2010-07-20  8:54 ` Richard Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Charles Forsyth @ 2010-07-19 21:25 UTC (permalink / raw)
  To: 9fans

>Is one interrupt being dispatched to two cpus, I wonder?

even so, that should be fine, but ether8169.c doesn't seem to make much use of the rlock it declares.



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

* Re: [9fans] apic fail
  2010-07-19 21:25 ` Charles Forsyth
@ 2010-07-19 21:55   ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2010-07-19 21:55 UTC (permalink / raw)
  To: 9fans

On Mon Jul 19 17:26:13 EDT 2010, forsyth@terzarima.net wrote:
> >Is one interrupt being dispatched to two cpus, I wonder?
>
> even so, that should be fine, but ether8169.c doesn't seem to make much use of the rlock it declares.

really?   i thought a bedrock assumption of pci interrupts is
that once an interrupt vector is asserted, it can't reassert until
the os has acked that vector with EOI.

it may be that the same interrupt source is mapped to different
vectors on the different processors.  that would be an interesting
world to live in.

- erik



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

* Re: [9fans] apic fail
  2010-07-19 20:14 [9fans] apic fail Richard Miller
  2010-07-19 21:25 ` Charles Forsyth
@ 2010-07-20  8:54 ` Richard Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Miller @ 2010-07-20  8:54 UTC (permalink / raw)
  To: 9fans

> Is one interrupt being dispatched to two cpus, I wonder?

The answer appears to be yes.  I bracketed rtl8169interrupt()
with these lines:

static void
rtl8169interrupt(Ureg*, void* arg)
{
  ...
  static Ref twice;
  if(incref(&twice) != 1) iprint("cpu%d: I see everything twice!\n", m->machno);
  ...
  decref(&twice);
}

The result on rebooting was:

cpu0: I see everything twice!
cpu1: I see everything twice!
cpu0: I see everything twice!
cpu0: I see everything twice!
...

many times over.

As a side effect this stops the kernel from crashing, because while one cpu
is doing its iprint, the other can get on with its interrupt routine safely.




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

end of thread, other threads:[~2010-07-20  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 20:14 [9fans] apic fail Richard Miller
2010-07-19 21:25 ` Charles Forsyth
2010-07-19 21:55   ` erik quanstrom
2010-07-20  8:54 ` Richard Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).