<s>
In	O
operating	B-General_Concept
systems	I-General_Concept
,	O
an	O
interrupt	B-General_Concept
storm	I-General_Concept
is	O
an	O
event	O
during	O
which	O
a	O
processor	O
receives	O
an	O
inordinate	O
number	O
of	O
interrupts	B-Application
that	O
consume	O
the	O
majority	O
of	O
the	O
processor	O
's	O
time	O
.	O
</s>
<s>
Interrupt	B-General_Concept
storms	I-General_Concept
are	O
typically	O
caused	O
by	O
hardware	O
devices	O
that	O
do	O
not	O
support	O
interrupt	B-Application
rate	O
limiting	O
.	O
</s>
<s>
Because	O
interrupt	B-Application
processing	O
is	O
typically	O
a	O
non-preemptible	O
task	O
in	O
time-sharing	B-General_Concept
operating	I-General_Concept
systems	I-General_Concept
,	O
an	O
interrupt	B-General_Concept
storm	I-General_Concept
will	O
cause	O
sluggish	O
response	O
to	O
user	O
input	O
,	O
or	O
even	O
appear	O
to	O
freeze	B-General_Concept
the	O
system	O
completely	O
.	O
</s>
<s>
In	O
such	O
a	O
state	O
,	O
the	O
system	O
is	O
spending	O
most	O
of	O
its	O
resources	O
processing	O
interrupts	B-Application
instead	O
of	O
completing	O
other	O
work	O
.	O
</s>
<s>
An	O
interrupt	B-General_Concept
storm	I-General_Concept
is	O
sometimes	O
mistaken	O
for	O
thrashing	B-General_Concept
,	O
since	O
they	O
both	O
have	O
similar	O
symptoms	O
(	O
unresponsive	O
or	O
sluggish	O
response	O
to	O
user	O
input	O
,	O
little	O
or	O
no	O
output	O
)	O
.	O
</s>
<s>
Common	O
causes	O
include	O
:	O
misconfigured	O
or	O
faulty	O
hardware	O
,	O
faulty	O
device	O
drivers	O
,	O
flaws	O
in	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
or	O
metastability	O
in	O
one	O
or	O
more	O
components	O
.	O
</s>
<s>
Most	O
modern	O
hardware	O
and	O
operating	B-General_Concept
systems	I-General_Concept
have	O
methods	O
for	O
mitigating	O
the	O
effect	O
of	O
an	O
interrupt	B-General_Concept
storm	I-General_Concept
.	O
</s>
<s>
For	O
example	O
,	O
most	O
Ethernet	O
controllers	O
implement	O
interrupt	B-Application
"	O
rate	O
limiting	O
"	O
,	O
which	O
causes	O
the	O
controller	O
to	O
wait	O
a	O
programmable	O
amount	O
of	O
time	O
between	O
each	O
interrupt	B-Application
it	O
generates	O
.	O
</s>
<s>
When	O
not	O
present	O
within	O
the	O
device	O
,	O
similar	O
functionality	O
is	O
usually	O
written	O
into	O
the	O
device	O
driver	O
,	O
and/or	O
the	O
operating	B-General_Concept
system	I-General_Concept
itself	O
.	O
</s>
<s>
The	O
most	O
common	O
cause	O
is	O
when	O
a	O
device	O
"	O
behind	O
"	O
another	O
signals	O
an	O
interrupt	B-Application
to	O
an	O
APIC	B-Device
(	O
Advanced	B-Device
Programmable	I-Device
Interrupt	I-Device
Controller	I-Device
)	O
.	O
</s>
<s>
Most	O
computer	O
peripherals	O
generate	O
interrupts	B-Application
through	O
an	O
APIC	B-Device
as	O
the	O
number	O
of	O
interrupts	B-Application
is	O
most	O
always	O
less	O
(	O
typically	O
15	O
for	O
the	O
modern	O
PC	O
)	O
than	O
the	O
number	O
of	O
devices	O
.	O
</s>
<s>
The	O
OS	O
must	O
then	O
query	O
each	O
driver	O
registered	O
to	O
that	O
interrupt	B-Application
to	O
ask	O
if	O
the	O
interrupt	B-Application
originated	O
from	O
its	O
hardware	O
.	O
</s>
<s>
Faulty	O
drivers	O
may	O
always	O
claim	O
"	O
yes	O
"	O
,	O
causing	O
the	O
OS	O
to	O
not	O
query	O
other	O
drivers	O
registered	O
to	O
that	O
interrupt	B-Application
(	O
only	O
one	O
interrupt	B-Application
can	O
be	O
processed	O
at	O
a	O
time	O
)	O
.	O
</s>
<s>
The	O
device	O
which	O
originally	O
requested	O
the	O
interrupt	B-Application
therefore	O
does	O
not	O
get	O
its	O
interrupt	B-Application
serviced	O
,	O
so	O
a	O
new	O
interrupt	B-Application
is	O
generated	O
(	O
or	O
is	O
not	O
cleared	O
)	O
and	O
the	O
processor	O
becomes	O
swamped	O
with	O
continuous	O
interrupt	B-Application
signals	O
.	O
</s>
<s>
Any	O
operating	B-General_Concept
system	I-General_Concept
can	O
live	O
lock	O
under	O
an	O
interrupt	B-General_Concept
storm	I-General_Concept
caused	O
by	O
such	O
a	O
fault	O
.	O
</s>
<s>
A	O
kernel	B-Operating_System
debugger	B-Application
can	O
usually	O
break	O
the	O
storm	O
by	O
unloading	O
the	O
faulty	O
driver	O
,	O
allowing	O
the	O
driver	O
"	O
underneath	O
"	O
the	O
faulty	O
one	O
to	O
clear	O
the	O
interrupt	B-Application
,	O
if	O
user	O
input	O
is	O
still	O
possible	O
.	O
</s>
<s>
As	O
drivers	O
are	O
most	O
often	O
implemented	O
by	O
a	O
3rd	O
party	O
,	O
most	O
operating	B-General_Concept
systems	I-General_Concept
also	O
have	O
a	O
polling	B-General_Concept
mode	O
that	O
queries	O
for	O
pending	O
interrupts	B-Application
at	O
fixed	O
intervals	O
or	O
in	O
a	O
round-robin	O
fashion	O
.	O
</s>
<s>
This	O
mode	O
can	O
be	O
set	O
globally	O
,	O
on	O
a	O
per-driver	O
,	O
per-interrupt	O
basis	O
,	O
or	O
dynamically	O
if	O
the	O
OS	O
detects	O
a	O
fault	O
condition	O
or	O
excessive	O
interrupt	B-Application
generation	O
.	O
</s>
<s>
A	O
polling	B-General_Concept
mode	O
may	O
be	O
enabled	O
dynamically	O
when	O
the	O
number	O
of	O
interrupts	B-Application
or	O
the	O
resource	O
use	O
caused	O
by	O
an	O
interrupt	B-Application
,	O
passes	O
certain	O
thresholds	O
.	O
</s>
<s>
When	O
these	O
thresholds	O
are	O
no	O
longer	O
exceeded	O
,	O
an	O
OS	O
may	O
then	O
change	O
the	O
interrupting	B-Application
driver	O
,	O
interrupt	B-Application
,	O
or	O
interrupt	B-Application
handling	I-Application
globally	O
,	O
from	O
an	O
interrupt	B-Application
mode	O
to	O
a	O
polling	B-General_Concept
mode	O
.	O
</s>
<s>
Interrupt	B-Application
rate	O
limiting	O
in	O
hardware	O
usually	O
negates	O
the	O
use	O
of	O
a	O
polling	B-General_Concept
mode	O
,	O
but	O
can	O
still	O
happen	O
during	O
normal	O
operation	O
during	O
intense	O
I/O	O
if	O
the	O
processor	O
is	O
unable	O
switch	O
contexts	O
quickly	O
enough	O
to	O
keep	O
pace	O
.	O
</s>
<s>
Perhaps	O
the	O
first	O
interrupt	B-General_Concept
storm	I-General_Concept
occurred	O
during	O
the	O
Apollo	O
11	O
's	O
lunar	O
descent	O
in	O
1969	O
.	O
</s>
<s>
Interrupt	B-Application
rate	O
limiting	O
must	O
be	O
carefully	O
configured	O
for	O
optimum	O
results	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
Ethernet	O
controller	O
with	O
interrupt	B-Application
rate	O
limiting	O
will	O
buffer	O
the	O
packets	B-Protocol
it	O
receives	O
from	O
the	O
network	O
in	O
between	O
each	O
interrupt	B-Application
.	O
</s>
<s>
If	O
the	O
rate	O
is	O
set	O
too	O
low	O
,	O
the	O
controller	O
's	O
buffer	O
will	O
overflow	O
,	O
and	O
packets	B-Protocol
will	O
be	O
dropped	O
.	O
</s>
<s>
The	O
rate	O
must	O
take	O
into	O
account	O
how	O
fast	O
the	O
buffer	O
may	O
fill	O
between	O
interrupts	B-Application
,	O
and	O
the	O
interrupt	B-General_Concept
latency	I-General_Concept
between	O
the	O
interrupt	B-Application
and	O
the	O
transfer	O
of	O
the	O
buffer	O
to	O
the	O
system	O
.	O
</s>
<s>
For	O
example	O
,	O
FreeBSD	B-Operating_System
detects	O
interrupt	B-General_Concept
storms	I-General_Concept
and	O
masks	O
problematic	O
interrupts	B-Application
for	O
some	O
time	O
in	O
response	O
.	O
</s>
<s>
The	O
system	O
used	O
by	O
NAPI	B-Architecture
is	O
an	O
example	O
of	O
the	O
hardware-based	O
approach	O
:	O
the	O
system	O
(	O
driver	O
)	O
starts	O
in	O
interrupt	B-Application
enabled	O
state	O
,	O
and	O
the	O
Interrupt	B-General_Concept
handler	I-General_Concept
then	O
disables	O
the	O
interrupt	B-Application
and	O
lets	O
a	O
thread/task	O
handle	O
the	O
event(s )	O
and	O
then	O
task	O
polls	O
the	O
device	O
,	O
processing	O
some	O
number	O
of	O
events	O
and	O
enabling	O
the	O
interrupt	B-Application
.	O
</s>
<s>
Another	O
interesting	O
approach	O
using	O
hardware	O
support	O
is	O
one	O
where	O
the	O
device	O
generates	O
interrupt	B-Application
when	O
the	O
event	O
queue	O
state	O
changes	O
from	O
"	O
empty	O
"	O
to	O
"	O
not	O
empty	O
"	O
.	O
</s>
<s>
If	O
at	O
that	O
point	O
entry	O
(	O
tail1	O
)	O
is	O
free	O
(	O
cleared	O
)	O
,	O
an	O
interrupt	B-Application
will	O
be	O
generated	O
(	O
level	O
interrupt	B-Application
)	O
and	O
the	O
tail	O
pointer	O
will	O
be	O
incremented	O
.	O
</s>
<s>
If	O
the	O
hardware	O
requires	O
the	O
interrupt	B-Application
be	O
acknowledged	O
,	O
the	O
CPU	O
(	O
interrupt	B-General_Concept
handler	I-General_Concept
)	O
will	O
do	O
that	O
,	O
handle	O
the	O
valid	O
DMA	O
descriptors	O
at	O
the	O
head	O
,	O
and	O
return	O
from	O
the	O
interrupt	B-Application
.	O
</s>
