Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 18:11:08 -0800
From:      Michael Smith <msmith@freebsd.org>
To:        "M. Warner Losh" <imp@village.org>
Cc:        smp@FreeBSD.org
Subject:   Interrupt Context becomes a misnomer (was  Re: Core recognizes SMPng tech lead )
Message-ID:  <200203080211.g282BAt01489@mass.dis.org>
In-Reply-To: Your message of "Thu, 07 Mar 2002 18:56:17 MST." <20020307.185617.118790071.imp@village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

(moved to smp@)

> This can be described as "newbus doesn't change often enough to do
> anything other than one big lock around it."  However, I must admit
> that I've not thought through the implications of devices arriving and
> leaving at interrupt context.

I've been talking about this with various people, but here's a good point 
at which to bring up something that folks working on device drivers 
should think long and hard about.

We should stop doing (almost) anything in "interrupt context".  An 
interrupt handler should at most:

 - pacify the interrupting device
 - make the driver's interrupt thread runnable

Now, before you all start screaming about "fast interrupts", yes, there 
are a few devices that require special treatment.  But there aren't many 
of them, and they can be accomodated in this model (by doing slightly 
more in the interrupt handler).

In the case where a device can't be "pacified" without considerable work 
(this is fairly rare), the handler can return status indicating that the 
interrupt should be masked until the thread has run.

You can turn the concept on it's head and view it as making every driver 
have a "fast" interrupt handler.  "Slow" handlers go away, making the 
issue of handling things "in interrupt context" much less of a problem, 
since almost nothing (clock code notwithstanding) is called from 
interrupt context.

This isn't a particularly novel approach; Apple use it, BSD/OS is likely 
to go this way, and it's strongly encouraged by the IA64 interrupt model. 
I'm sure that plenty of other systems do things this way as well; I just 
don't have the research hours to track them down.

Just food for thought at this stage, but something that anyone working on 
interrupt handling should take to heart.

Regards,
Mike

-- 
To announce that there must be no criticism of the president,
or that we are to stand by the president, right or wrong, is not
only unpatriotic and servile, but is morally treasonable to 
the American public.  - Theodore Roosevelt



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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