Subject: Re: wm behaviour on NetBSD
To: None <jadacuma@ched.gov.ph>
From: Chuck Swiger <cswiger@mac.com>
List: netbsd-users
Date: 11/27/2005 14:39:29
Joseph A. Dacuma wrote:
> Hi Mr. Swiger!

Hi...

[ *looks around by reflex*  I think of myself as "Chuck" and my father as "Mr. 
Swiger", but that's all right-- I suppose I can answer to either name.  :-) ]

>> He may be talking about an "interrupt aliasing" problem with the Intel
>> gigabit NIC when APIC and SMP is enabled; Jeff, you might try disabling the USB
>> controller if you can and see whether the NIC works better without
>> something sharing the interrupt.
>>
>> There's a thread here with lots of details:
>>
>> http://lists.freebsd.org/pipermail/freebsd-current/2005-November/058383.html
> 
> Not exactly on NetBSD 3 branch. I also experienced that personally when I
> installed FreeBSD 5.x on the same machine (Dell 2800). But I'll go check
> tommorow if theres an interrupt conflict and probably thats the reason why
> I'm generating errors when [doing] huge file transfers via network.

You may be right that the problem in that thread isn't exactly the issue 
affecting NetBSD 3, but it sounds close enough that checking interrupt rates 
and/or seeing whether it helps to reduce sharing of IRQs with the em/wm Intel 
NIC device is still worth the try.

There seems to be a difference in the way Dell 28[0,5]0 hardware handles 
interrupts from most other APIC hardware, and this seems to affect 
Solaris/Intel and other platforms besides FreeBSD too, so if NetBSD also 
encounted slowdowns or even hardware lockups under load with the onboard Intel 
NIC(s), it's not an isolated issue by any means.

Please do post some interrupt numbers if you are seeing the problem, so that 
people who know more about NetBSD then I can have specific info to work with.

-- 
-Chuck

PS: Apparently switching the IRQ from being level triggered to being 
edge-triggered and then masking it until your interrupt handler has finished 
running will help reduce the IRQ storm.

Or so I guess...I know what an APIC is, and the difference between edge and 
level-triggered interrupts, but how driver re-entrency is handled and whether 
NetBSD has a kernel thread per IRQ (aka FreeBSD ithreads), or per driver 
instance (aka IOKit in MacOS X), or uses a more classic dispatch/continuation 
model (older BSD) for interrupt handling is not as clear to me.