Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2002 14:11:09 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        arch@FreeBSD.org
Subject:   RE: multiple threads for interrupts
Message-ID:  <XFMail.20020626141109.jhb@FreeBSD.org>
In-Reply-To: <200206201035.g5KAZ53i029301@rina.r.dl.itc.u-tokyo.ac.jp>

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

On 20-Jun-2002 Seigo Tanimura wrote:
> At the moment, each interrupt type (hardware and swi) has only one
> kernel thread to handle interrupts.  This can be a potential
> bottleneck in an SMP host because virtually only up to one processor
> can handle interrupts.
> 
> One solution is to run multiple threads for each of the interrupt
> types.  Since I noticed this issue first during my work of network
> locking, I have been tweaking the swi subsystem so that it runs
> multiple threads for an swi type.  For those who are interested, the
> patch can be found at:
> 
> http://people.FreeBSD.org/~tanimura/patches/swipool.diff.gz
> 
> While I worked on only swis, hardware interrupts should suffer from
> the same issue as well.  Thus it would be better to tweak the general
> interrupt mechanism rather than only the swi subsystem.  I will see
> how that works in the next few days.
> 
> Comments and flames are welcome.  Thanks a lot.

I think this is mostly a feature rather than a bug.  Allowing more than
one handler to execute at a time requires you to use a semaphore or some
such to coordinate when you actually enable the interrupt source again.
I also think that you are better off waiting for KSE to finish and for
us to support per-CPU runqueues with binding so that for processes where
it makes sense to do this (like netisr and possibly the cam stuff, ktrace
is another potential candidate), you use bound per-cpu threads that still
belong to the same process to do this.  FWIW, Solaris doesn't use multiple
threads for a shared interrupt, instead, when an ithread is awakened, it
is bound to the CPU receiving the interrupt until it finishes.  If you
don't have a copy of Solaris Internals I would recommend getting a
copy. :)

We don't have to be the next Solaris, but we can learn a lot by looking
at it.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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




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