Interrupt Latency of ACPI vs Standard PC

In addition to being a software developer I also do a fair amount of
musical composition with digital audio hardware. There is debate; some
would say a conviction, that a PC has the ability to provide lower
interrupt latency when configured with the Standard PC HAL with no
interrupt sharing among devices, vs. the ACPI HAL with interrupt
sharing. This supposedly prevents pop and clicks during recording and
allows one to us a lower latency between sound input and recording. This
being a device driver forum I thought here would be a good place to ask
the question: Is there the possibility of achieving lower interrupt
latency when using the Standard PC HAL instead of ACPI?

Personally, my recording system is configured with XP using ACPI and
I’ve never experienced any problems with high latency, although I may
not stress my system as much as other do.

Thanks,

Jim Young

Young Endeavors Software
xxxxx@youngendeavors.com

I believe that starting with XP the acpi hal attempts to minimize interrupt
sharing, while unfortunately windows 2000 more or less maximized it for PCI
devices.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jim Young
Sent: Saturday, February 14, 2004 2:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC

In addition to being a software developer I also do a fair
amount of musical composition with digital audio hardware.
There is debate; some would say a conviction, that a PC has
the ability to provide lower interrupt latency when
configured with the Standard PC HAL with no interrupt sharing
among devices, vs. the ACPI HAL with interrupt sharing. This
supposedly prevents pop and clicks during recording and
allows one to us a lower latency between sound input and
recording. This being a device driver forum I thought here
would be a good place to ask the question: Is there the
possibility of achieving lower interrupt latency when using
the Standard PC HAL instead of ACPI?

Personally, my recording system is configured with XP using
ACPI and I’ve never experienced any problems with high
latency, although I may not stress my system as much as other do.

Thanks,

Jim Young

Young Endeavors Software
xxxxx@youngendeavors.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Whereas I have a 1GHz machine with 512M that configured as ACPI and put
every device in the system on IRQ 9. No matter what fiddling I did with
priorities, it was impossible to get clickless audio out of the box on any
of the 3 interfaces on it. The raid (also on irq 9) was totally useless for
audio.

Reconfiguring it as non-acpi and distributing the audio devices away from
the raid onto other interrupts, and one in particular of the audio devices
onto its own interrupt, solved all the problems.

Now, does this indicate problems with interrupt sharing in at least one of
the drivers? Maybe. Or maybe it means that interrupt priority gets a
chance to be used, although I admit to not having checked the irql that the
various drivers are running at. I would hope that audio drivers get higher
priority than disk drivers, but I don’t recall an interface that would let a
driver request a particular priority class in the WDM world.

It is more than a little annoying when a machine has 4 available interrupts
and the OS flat refuses to use 3 of them and puts all devices on the 4th
one. Especially when the hardware spec for servers requires that each PCI
slot have its own interrupt available. Why bother with a separate interrupt
available on each slot if the OS is going to go out of its way to combine
the interrupts?

Loren

----- Original Message -----
From: “Jim Young”
To: “Windows System Software Devs Interest List”
Sent: Saturday, February 14, 2004 11:13 AM
Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC

In addition to being a software developer I also do a fair amount of
musical composition with digital audio hardware. There is debate; some
would say a conviction, that a PC has the ability to provide lower
interrupt latency when configured with the Standard PC HAL with no
interrupt sharing among devices, vs. the ACPI HAL with interrupt
sharing. This supposedly prevents pop and clicks during recording and
allows one to us a lower latency between sound input and recording. This
being a device driver forum I thought here would be a good place to ask
the question: Is there the possibility of achieving lower interrupt
latency when using the Standard PC HAL instead of ACPI?

Personally, my recording system is configured with XP using ACPI and
I’ve never experienced any problems with high latency, although I may
not stress my system as much as other do.

Thanks,

Jim Young

Young Endeavors Software
xxxxx@youngendeavors.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@earthlink.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Unfortunately, in addition to interrupt latency due to shared IRQs, there is still the factor of badly behaved drivers spending too much time at DISPATCH_LEVEL, or at DIRQL in their ISR.   There are other cases also like excessive use of KeStallExecutionProcessor (back to back or not) at DISPATCH_LEVEL.  Fortunately, MS will include some enforcement in WHQL and hopefully driver verifier: http://www.microsoft.com/whdc/hwdev/driver/mmdrv.mspx

Related question:  would running a non ACPI HAL on modern ACPI hardware result in obscure symptoms?   

Philip Lukidis

From: “Jim Young”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
>Date: Sat, 14 Feb 2004 11:13:40 -0800
>
>In addition to being a software developer I also do a fair amount of
>musical composition with digital audio hardware. There is debate; some
>would say a conviction, that a PC has the ability to provide lower
>interrupt latency when configured with the Standard PC HAL with no
>interrupt sharing among devices, vs. the ACPI HAL with interrupt
>sharing. This supposedly prevents pop and clicks during recording and
>allows one to us a lower latency between sound input and recording. This
>being a device driver forum I thought here would be a good place to ask
>the question: Is there the possibility of achieving lower interrupt
>latency when using the Standard PC HAL instead of ACPI?
>
>Personally, my recording system is configured with XP using ACPI and
>I’ve never experienced any problems with high latency, although I may
>not stress my system as much as other do.
>
>Thanks,
>
>Jim Young
>
>Young Endeavors Software
>xxxxx@youngendeavors.com
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.

A couple of comments. You don’t say what OS you’re using, so I’ll assume
it’s XP. If in fact it’s, Windows 2000, then the behavior you are seeing is
normal.

If it’s XP, then your machine will only behave that way if we believe that
the BIOS on it is broken, in the sense that it was only well-tested with
Windows 2000, and that it will fail if it is used in any mode not consistent
with Win2K. Many BIOS bugs related to dynamic interrupt routing were hidden
by Win2K’s propensity to stack all PCI IRQs on top of whatever IRQ was being
used for the ACPI System Control Interrupt (SCI.) There is a list, which
you are welcome to peruse, in biosinfo.inf. Look for the symbol
“AcpiIrqRoutingStackOnSci”. Your machine may be listed.

Alternatively, XP will assume that any machine with either a VIA 586 or 686
south bridge has a busted BIOS. This is because VIA’s south bridge works
differently from Intel’s south bridge (completely legitimately,) but most
BIOSes seem to be based on the Intel reference examples, meaning that they
don’t work correctly with VIA’s chip in this area.

The symptoms of a machine with a broken BIOS are generally hangs due to
interrupt storms at boot, suspend or resume time. You’re welcome to remove
the reg keys that are set in biosinfo.inf and see if your machine happens to
truly be among the afflicted. (If it’s a VIA machine, the HAL will put the
keys back even if you delete them.) The sorry truth is that many, many
BIOSes copy their IDs from previous BIOSes. So if we put even one of them
on a hack list, it often affects lots of machines that actually work. We’ve
been asking BIOS companies for years to ensure that the IDs in their
machines are unique, but it’s a hard message to get across. (It’s also
sadly true that it’s rarely the orginal BIOS that is busted. So innocent
earlier machines are often put on the hack list simply because some later
machine with the same IDs was broken.)


Jake Oshins
Windows Base Kernel Team
This posting is provided “AS IS” with no warranties, and confers no rights.

“Loren Wilton” wrote in message news:xxxxx@ntdev…
> Whereas I have a 1GHz machine with 512M that configured as ACPI and put
> every device in the system on IRQ 9. No matter what fiddling I did with
> priorities, it was impossible to get clickless audio out of the box on any
> of the 3 interfaces on it. The raid (also on irq 9) was totally useless
> for
> audio.
>
> Reconfiguring it as non-acpi and distributing the audio devices away from
> the raid onto other interrupts, and one in particular of the audio devices
> onto its own interrupt, solved all the problems.
>
> Now, does this indicate problems with interrupt sharing in at least one of
> the drivers? Maybe. Or maybe it means that interrupt priority gets a
> chance to be used, although I admit to not having checked the irql that
> the
> various drivers are running at. I would hope that audio drivers get
> higher
> priority than disk drivers, but I don’t recall an interface that would let
> a
> driver request a particular priority class in the WDM world.
>
> It is more than a little annoying when a machine has 4 available
> interrupts
> and the OS flat refuses to use 3 of them and puts all devices on the 4th
> one. Especially when the hardware spec for servers requires that each PCI
> slot have its own interrupt available. Why bother with a separate
> interrupt
> available on each slot if the OS is going to go out of its way to combine
> the interrupts?
>
> Loren
>
> ----- Original Message -----
> From: “Jim Young”
> To: “Windows System Software Devs Interest List”
> Sent: Saturday, February 14, 2004 11:13 AM
> Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
>
>
> In addition to being a software developer I also do a fair amount of
> musical composition with digital audio hardware. There is debate; some
> would say a conviction, that a PC has the ability to provide lower
> interrupt latency when configured with the Standard PC HAL with no
> interrupt sharing among devices, vs. the ACPI HAL with interrupt
> sharing. This supposedly prevents pop and clicks during recording and
> allows one to us a lower latency between sound input and recording. This
> being a device driver forum I thought here would be a good place to ask
> the question: Is there the possibility of achieving lower interrupt
> latency when using the Standard PC HAL instead of ACPI?
>
> Personally, my recording system is configured with XP using ACPI and
> I’ve never experienced any problems with high latency, although I may
> not stress my system as much as other do.
>
> Thanks,
>
> Jim Young
>
> Young Endeavors Software
> xxxxx@youngendeavors.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@earthlink.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

No. It will result in reduced functionality, in a lot of little areas
related to hardware management.


Jake Oshins
Windows Base Kernel Team
This posting is provided “AS IS” with no warranties, and confers no rights.

“pagefault 0x0” wrote in message
news:xxxxx@ntdev…
Unfortunately, in addition to interrupt latency due to shared IRQs, there is
still the factor of badly behaved drivers spending too much time at
DISPATCH_LEVEL, or at DIRQL in their ISR. There are other cases also like
excessive use of KeStallExecutionProcessor (back to back or not) at
DISPATCH_LEVEL. Fortunately, MS will include some enforcement in WHQL and
hopefully driver verifier:
http://www.microsoft.com/whdc/hwdev/driver/mmdrv.mspx
Related question: would running a non ACPI HAL on modern ACPI hardware
result in obscure symptoms?
Philip Lukidis

>From: “Jim Young”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
>Date: Sat, 14 Feb 2004 11:13:40 -0800
>
>In addition to being a software developer I also do a fair amount of
>musical composition with digital audio hardware. There is debate; some
>would say a conviction, that a PC has the ability to provide lower
>interrupt latency when configured with the Standard PC HAL with no
>interrupt sharing among devices, vs. the ACPI HAL with interrupt
>sharing. This supposedly prevents pop and clicks during recording and
>allows one to us a lower latency between sound input and recording. This
>being a device driver forum I thought here would be a good place to ask
>the question: Is there the possibility of achieving lower interrupt
>latency when using the Standard PC HAL instead of ACPI?
>
>Personally, my recording system is configured with XP using ACPI and
>I’ve never experienced any problems with high latency, although I may
>not stress my system as much as other do.
>
>Thanks,
>
>Jim Young
>
>Young Endeavors Software
>xxxxx@youngendeavors.com
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.

By the way, the priority interfaces that you rightly don’t recall have been
added to Longhorn. See http://www.microsoft.com/whdc/hwdev/bus/pci/MSI.mspx


Jake Oshins
Windows Base Kernel Team
This posting is provided “AS IS” with no warranties, and confers no rights.

“Loren Wilton” wrote in message news:xxxxx@ntdev…
> Whereas I have a 1GHz machine with 512M that configured as ACPI and put
> every device in the system on IRQ 9. No matter what fiddling I did with
> priorities, it was impossible to get clickless audio out of the box on any
> of the 3 interfaces on it. The raid (also on irq 9) was totally useless
> for
> audio.
>
> Reconfiguring it as non-acpi and distributing the audio devices away from
> the raid onto other interrupts, and one in particular of the audio devices
> onto its own interrupt, solved all the problems.
>
> Now, does this indicate problems with interrupt sharing in at least one of
> the drivers? Maybe. Or maybe it means that interrupt priority gets a
> chance to be used, although I admit to not having checked the irql that
> the
> various drivers are running at. I would hope that audio drivers get
> higher
> priority than disk drivers, but I don’t recall an interface that would let
> a
> driver request a particular priority class in the WDM world.
>
> It is more than a little annoying when a machine has 4 available
> interrupts
> and the OS flat refuses to use 3 of them and puts all devices on the 4th
> one. Especially when the hardware spec for servers requires that each PCI
> slot have its own interrupt available. Why bother with a separate
> interrupt
> available on each slot if the OS is going to go out of its way to combine
> the interrupts?
>
> Loren
>
> ----- Original Message -----
> From: “Jim Young”
> To: “Windows System Software Devs Interest List”
> Sent: Saturday, February 14, 2004 11:13 AM
> Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
>
>
> In addition to being a software developer I also do a fair amount of
> musical composition with digital audio hardware. There is debate; some
> would say a conviction, that a PC has the ability to provide lower
> interrupt latency when configured with the Standard PC HAL with no
> interrupt sharing among devices, vs. the ACPI HAL with interrupt
> sharing. This supposedly prevents pop and clicks during recording and
> allows one to us a lower latency between sound input and recording. This
> being a device driver forum I thought here would be a good place to ask
> the question: Is there the possibility of achieving lower interrupt
> latency when using the Standard PC HAL instead of ACPI?
>
> Personally, my recording system is configured with XP using ACPI and
> I’ve never experienced any problems with high latency, although I may
> not stress my system as much as other do.
>
> Thanks,
>
> Jim Young
>
> Young Endeavors Software
> xxxxx@youngendeavors.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@earthlink.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

Interesting. A lot of that will be right useful, especially on servers. I
can see some things that look like problems though. For instance it seems
you have to specify the interrupt affinity in a registry entry, and the time
at which that is interrogated isn’t specified. If it is at driver load time
this totally breaks dynamic load balancing (in those cases where the
hardware can route to multiple places, but it might be better to route it to
specific places).

I also wish there had been about one more interrupt priority level of
“medium high”. Or perhaps some symbolically named levels. For instance,
the legacy comport mentioned in the document probably does require the
lowest latency, especially at high baud rates. An ASIO audio driver would
probably come in just under this requirement, but a heck of a lot higher
than a disk driver, which might have normal or even low priority. I suspect
a mouse probably would come in at a normal priority, or maybe even a touch
higher than that. A keyboard is probably low priority.

There probably should have been named priorities like “keyboard_priority”
and “mouse_priority” and “network_priority/low/medium/high” that would map
to the available values, and a careful discussion of why these values were
set as they were.

This would make it easier for the jive driver writer to pick the right level
out of the bucket most of the time, but to also understand why it might be
appropriate to pick a different level if the hardware truely didn’t match
the assumptions of the normal priority class for that type of device. Just
saying “always use medium priority and WHQL has a big stick to prevent you
using high priority” is really a bit too simplistic. This is an area where
most people probably could make correct decisions, given a little more
information about interrupt behaviour than most people are likely to know
off the top of their heads. That information could be supplied.

For instance, serial port interrupt latency requirements are based on both
baud rate and fifo depth, if you want to get picky about it. They could go
from ultra-low priority to extremely high, largely depending on baudrate.
Which implies that they can dynamically reorder, since baud rate change at
almost any time.

Loren

----- Original Message -----
From: “Jake Oshins”

> By the way, the priority interfaces that you rightly don’t recall have
been
> added to Longhorn. See
http://www.microsoft.com/whdc/hwdev/bus/pci/MSI.mspx

Let me say that when Jake Oshins writes in this newgroup I listen. Thanks Jake. I agree about spending too much time at IRQL DISPATCH_LEVEL. I remember a motion JPEG recorder for a Video Chip Company that was spending too much time at IRQL DISPATCH_LEVEL. We got some very strange behavior with win32k.sys I think where video would not repaint when recording video. Never did understand why it appeared to be mix of time and DPCs frequency.
Thanks

-----Original Message-----
From: Jake Oshins
Sent: Feb 15, 2004 1:17 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Interrupt Latency of ACPI vs Standard PC

No. It will result in reduced functionality, in a lot of little areas
related to hardware management.


Jake Oshins
Windows Base Kernel Team
This posting is provided “AS IS” with no warranties, and confers no rights.

“pagefault 0x0” wrote in message
news:xxxxx@ntdev…
Unfortunately, in addition to interrupt latency due to shared IRQs, there is
still the factor of badly behaved drivers spending too much time at
DISPATCH_LEVEL, or at DIRQL in their ISR. There are other cases also like
excessive use of KeStallExecutionProcessor (back to back or not) at
DISPATCH_LEVEL. Fortunately, MS will include some enforcement in WHQL and
hopefully driver verifier:
http://www.microsoft.com/whdc/hwdev/driver/mmdrv.mspx
Related question: would running a non ACPI HAL on modern ACPI hardware
result in obscure symptoms?
Philip Lukidis

>From: “Jim Young”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
>Date: Sat, 14 Feb 2004 11:13:40 -0800
>
>In addition to being a software developer I also do a fair amount of
>musical composition with digital audio hardware. There is debate; some
>would say a conviction, that a PC has the ability to provide lower
>interrupt latency when configured with the Standard PC HAL with no
>interrupt sharing among devices, vs. the ACPI HAL with interrupt
>sharing. This supposedly prevents pop and clicks during recording and
>allows one to us a lower latency between sound input and recording. This
>being a device driver forum I thought here would be a good place to ask
>the question: Is there the possibility of achieving lower interrupt
>latency when using the Standard PC HAL instead of ACPI?
>
>Personally, my recording system is configured with XP using ACPI and
>I’ve never experienced any problems with high latency, although I may
>not stress my system as much as other do.
>
>Thanks,
>
>Jim Young
>
>Young Endeavors Software
>xxxxx@youngendeavors.com
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@earthlink.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

> There probably should have been named priorities like “keyboard_priority”

and “mouse_priority” and “network_priority/low/medium/high” that would map

They are: IO_DISK_INCREMENT and friends.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Absolutely, I always value reading his responses, not to mention those of others as well on a wide variety of threads.  Right now I am profiling my code in order to make sure that I respect the recommendations given in the MS white paper.

Philip Lukidis

From: xxxxx@earthlink.net

Reply-To: “Windows System Software Devs Interest List”

>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Interrupt Latency of ACPI vs Standard PC
>Date: Mon, 16 Feb 2004 09:10:51 -0500 (GMT-05:00)
>
>Let me say that when Jake Oshins writes in this newgroup I listen. Thanks Jake. I agree about spending too much time at IRQL DISPATCH_LEVEL. I remember a motion JPEG recorder for a Video Chip Company that was spending too much time at IRQL DISPATCH_LEVEL. We got some very strange behavior with win32k.sys I think where video would not repaint when recording video. Never did understand why it appeared to be mix of time and DPCs frequency.
>Thanks
>
>
>
>-----Original Message-----
>From: Jake Oshins
>Sent: Feb 15, 2004 1:17 PM
>To: Windows System Software Devs Interest List
>Subject: Re:[ntdev] Interrupt Latency of ACPI vs Standard PC
>
>No. It will result in reduced functionality, in a lot of little areas
>related to hardware management.
>
>–
>Jake Oshins
>Windows Base Kernel Team
>This posting is provided “AS IS” with no warranties, and confers no rights.
>
>“pagefault 0x0” wrote in message
>news:xxxxx@ntdev…
>Unfortunately, in addition to interrupt latency due to shared IRQs, there is
>still the factor of badly behaved drivers spending too much time at
>DISPATCH_LEVEL, or at DIRQL in their ISR. There are other cases also like
>excessive use of KeStallExecutionProcessor (back to back or not) at
>DISPATCH_LEVEL. Fortunately, MS will include some enforcement in WHQL and
>hopefully driver verifier:
>http://www.microsoft.com/whdc/hwdev/driver/mmdrv.mspx
>Related question: would running a non ACPI HAL on modern ACPI hardware
>result in obscure symptoms?
>Philip Lukidis
>
> >From: “Jim Young”
> >Reply-To: “Windows System Software Devs Interest List”
> >To: “Windows System Software Devs Interest List”
> >Subject: [ntdev] Interrupt Latency of ACPI vs Standard PC
> >Date: Sat, 14 Feb 2004 11:13:40 -0800
> >
> >In addition to being a software developer I also do a fair amount of
> >musical composition with digital audio hardware. There is debate; some
> >would say a conviction, that a PC has the ability to provide lower
> >interrupt latency when configured with the Standard PC HAL with no
> >interrupt sharing among devices, vs. the ACPI HAL with interrupt
> >sharing. This supposedly prevents pop and clicks during recording and
> >allows one to us a lower latency between sound input and recording. This
> >being a device driver forum I thought here would be a good place to ask
> >the question: Is there the possibility of achieving lower interrupt
> >latency when using the Standard PC HAL instead of ACPI?
> >
> >Personally, my recording system is configured with XP using ACPI and
> >I’ve never experienced any problems with high latency, although I may
> >not stress my system as much as other do.
> >
> >Thanks,
> >
> >Jim Young
> >
> >Young Endeavors Software
> >xxxxx@youngendeavors.com
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at
> >http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@earthlink.net
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Add photos to your messages with MSN 8. Get 2 months FREE*.

You’ve slightly misunderstood the part about affinities. While it was my
intention to make it possible to assign policies through the registry, I
never intended specific affinities to by applied there. That doesn’t make
any sense, as you can’t know at the time that you populate a reg key how
many processors are in the system. I expect that the kind of load balancing
you imagine will be done by applying polices during
IRP_MN_FILTER_RESOURCE_REQUIREMENTS time. I certainly designed the part of
the Driver Framework related to interrupts (shameless plug for technology
that will be explained at WinHEC) to do it that way.

The other policies that you can apply by setting reg keys are all relative
ones, like “assign my interrupt to one processor, preferably one that is
physically close to my device.”

The priority thing never satisfies anyone, no matter how you cut it. I have
three substantive responses.

  1. You can please some of the people some of the time, but not all of the
    people all of the time.

  2. Anything that you need that much control over is probably not best
    handled in an ISR.

  3. When the people working on a Real Time story for Longhorn get their
    story straighter, I’ll probably hook into what they do and allow you much
    finer control.


Jake Oshins
Windows Base Kernel Team
This posting is provided “AS IS” with no warranties, and confers no rights.

“Loren Wilton” wrote in message news:xxxxx@ntdev…
> Interesting. A lot of that will be right useful, especially on servers.
> I
> can see some things that look like problems though. For instance it seems
> you have to specify the interrupt affinity in a registry entry, and the
> time
> at which that is interrogated isn’t specified. If it is at driver load
> time
> this totally breaks dynamic load balancing (in those cases where the
> hardware can route to multiple places, but it might be better to route it
> to
> specific places).
>
> I also wish there had been about one more interrupt priority level of
> “medium high”. Or perhaps some symbolically named levels. For instance,
> the legacy comport mentioned in the document probably does require the
> lowest latency, especially at high baud rates. An ASIO audio driver would
> probably come in just under this requirement, but a heck of a lot higher
> than a disk driver, which might have normal or even low priority. I
> suspect
> a mouse probably would come in at a normal priority, or maybe even a touch
> higher than that. A keyboard is probably low priority.
>
> There probably should have been named priorities like “keyboard_priority”
> and “mouse_priority” and “network_priority/low/medium/high” that would map
> to the available values, and a careful discussion of why these values were
> set as they were.
>
> This would make it easier for the jive driver writer to pick the right
> level
> out of the bucket most of the time, but to also understand why it might be
> appropriate to pick a different level if the hardware truely didn’t match
> the assumptions of the normal priority class for that type of device.
> Just
> saying “always use medium priority and WHQL has a big stick to prevent you
> using high priority” is really a bit too simplistic. This is an area
> where
> most people probably could make correct decisions, given a little more
> information about interrupt behaviour than most people are likely to know
> off the top of their heads. That information could be supplied.
>
> For instance, serial port interrupt latency requirements are based on both
> baud rate and fifo depth, if you want to get picky about it. They could
> go
> from ultra-low priority to extremely high, largely depending on baudrate.
> Which implies that they can dynamically reorder, since baud rate change at
> almost any time.
>
>
> Loren
>
>
> ----- Original Message -----
> From: “Jake Oshins”
>
>
>> By the way, the priority interfaces that you rightly don’t recall have
> been
>> added to Longhorn. See
> http://www.microsoft.com/whdc/hwdev/bus/pci/MSI.mspx
>
>

Thanks Jake. I must not be getting enough sleep lately. Filter resource
requirements is indeed a good place to handle that sort of thing.

I agree, it is impossible to please all the people (or possibly any of the
people) all the time with interrupt routing. And the problem is that it is
every bit as important to performance as the device design, but is virtually
never under the control of the device designer or driver writer. Instead,
it is designed by some system designer who may or may not consider interrupt
latency an important consideration, and who almost certainly knows nothing
about any specific device and its needs.

So you have a case of someone who can write a driver for a device, and
possibly knows the interrupt needs or desires of the device for optimal
performance in isolation, but who knows nothing of the interrupt structure
on the system(s) it will be used in. And you have someone designing a
system, who, if he does anything with software at all, will write some BIOS
code that won’t be used during real operations anyway. And who might well
have less real knowlwdge of how the system will be used than even the driver
writer does.

And then the big problem is that all of this can’t be taken in isolation,
but has to be tuned with everything else happening in the system, which is
of course constantly varying, making optimal static tuning generally
impossible, unless one takes a really long-term definition of “optimal”.
But even that is difficult, because optimal is a matter of the user’s
definition, Does he want response time or thruput optimized? Well of
course he wants both; ignoring that, which does he want more? And it may be
different at noon than at 8PM.

Ideally the system should be completely self-tuning and the user’s options
limited to a single “Go Faster” slider, or more likely push button, and the
system will read the user’s mind and figure out what he *really* wants,
since he probably can’t actually express it himself in most cases. In a
less ideal world, one has to deal with more factors, and not all of them can
be static if truely optimal performance is the goal.

Which gets me to idly wondering about the concept of truely dynamic
interrupt routing/tuning as part of an adjustable performance strategy.
Processes and threads have adjustable priorities so that the user (or
someone) can give an indication of relative desires. I start wondering if
it would be reasonable to have interrupt affinity and priority levels
adjustable dynamically, much like thread priority. If you consider a
device/driver to be a process, then adjusting its relative priority doesn’t
sound like that strange a concept.

It may be difficult or impossible to implement anything like that, and of
course the knee-jerk reaction is to claim that it is all totally inherently
useless and I don’t want to think about it anymore. But I’ve been wondering
about that general idea for 30 years now, and I still haven’t found anything
that convinces me that it is NOT a good idea. Just that it is often
difficult to implement, and harder to quantify the likely results.

Loren

Loren,

Ideally the system should be completely self-tuning and the
user’s options
limited to a single “Go Faster” slider, or more likely push
button, and the
system will read the user’s mind and figure out what he
*really* wants,
since he probably can’t actually express it himself in most
cases. In a
less ideal world, one has to deal with more factors, and not
all of them can
be static if truely optimal performance is the goal.

I think the computer will be very confused if it could read my
mind ;-).
>
> Which gets me to idly wondering about the concept of truely dynamic
> interrupt routing/tuning as part of an adjustable performance
> strategy.
> Processes and threads have adjustable priorities so that the user (or
> someone) can give an indication of relative desires. I start
> wondering if
> it would be reasonable to have interrupt affinity and priority levels
> adjustable dynamically, much like thread priority. If you consider a
> device/driver to be a process, then adjusting its relative
> priority doesn’t
> sound like that strange a concept.

There are many conflicting goals to satisfy here, and the scheduling of
which interrupt gets the highest priority is never going to be
straightforward.

Obviously, a system where you have some sort of real time needs, say AV
playback, will need to have fast enough response-time on the relevant
interrupts to the AV playback. But if you raise the importance of the sound
card, and thus reduce the importance of the hard disk interrupt, you may get
problems to get the data across to the sound card. So although the latency
to the real-time critical part is lower, you’ve missed the goal-post by a
side effect of trying to get to the goal.

[The above is a completely made up example, and just for illustration
purposes. Please change devices around as you please. There is always some
sort of dependancy between one interrupt and another, that may cause things
to go wrong.]

In the ideal world, it shouldn’t really matter which interrupt has what
priority, because all interrupts are handled within such a short time that
the next one doesn’t get affected by the latency of other priorities.

This will of course not happen, but I believe the MS initiative to keep
interrupts short is a good one. This will certainly help. Now there’s of
course one problem with this: A system that has LOTS of interrupts, the
scheduling of DPC or some other mechanism to send work off to a lower IRQL
will take a lot of extra time. Not good for overall performance. So someone
will break the rules to improve performance, and we’re back at the beginning
of a “not so ideal world”.

I’m sometimes amazed at what slowness is allowed for interrupts to be
handled in Windows, and the system still runs nicely (i.e. it doesn’t crash
or behave too badly, you may get glitches in sound or video, but that’s it).
It’s very interesting to see how long an interrupt can actually be held
pending. It seems that it is ALMOST FOREVER (in computer time)…

I think the idea of automatically/runtime adjusted interrupts is a fine
idea. It’s just the implementation of the prioritization routine that I have
a hard time figuring how it should work. I would tend to prioritize
interrupts that run short times, and let the longer ones run at lower
priority. That should reduce the average latency. Of course, it’s not good
for the server system where someone copies a 256KB packet of data from the
disk to the main memory inside the interrupt handler, but they shouldn’t be
doing that in the first place, eh? :wink:


Mats

The best interrupt is no interrupt. Things like AV playback should be
handled 100% on the south side of the bus, no need to involve the processor
in it. I believe that if you run into performance issues because of
interrupt latency, it’s about time to migrate to a better architecture !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@3Dlabs.com
Sent: Tuesday, February 17, 2004 9:21 AM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] Re:Interrupt Latency of ACPI vs Standard PC

Loren,

Ideally the system should be completely self-tuning and the
user’s options
limited to a single “Go Faster” slider, or more likely push
button, and the
system will read the user’s mind and figure out what he
*really* wants,
since he probably can’t actually express it himself in most
cases. In a
less ideal world, one has to deal with more factors, and not
all of them can
be static if truely optimal performance is the goal.

I think the computer will be very confused if it could read my
mind ;-).
>
> Which gets me to idly wondering about the concept of truely dynamic
> interrupt routing/tuning as part of an adjustable performance
> strategy.
> Processes and threads have adjustable priorities so that the user (or
> someone) can give an indication of relative desires. I start
> wondering if
> it would be reasonable to have interrupt affinity and priority levels
> adjustable dynamically, much like thread priority. If you consider a
> device/driver to be a process, then adjusting its relative
> priority doesn’t
> sound like that strange a concept.

There are many conflicting goals to satisfy here, and the scheduling of
which interrupt gets the highest priority is never going to be
straightforward.

Obviously, a system where you have some sort of real time needs, say AV
playback, will need to have fast enough response-time on the relevant
interrupts to the AV playback. But if you raise the importance of the sound
card, and thus reduce the importance of the hard disk interrupt, you may get
problems to get the data across to the sound card. So although the latency
to the real-time critical part is lower, you’ve missed the goal-post by a
side effect of trying to get to the goal.

[The above is a completely made up example, and just for illustration
purposes. Please change devices around as you please. There is always some
sort of dependancy between one interrupt and another, that may cause things
to go wrong.]

In the ideal world, it shouldn’t really matter which interrupt has what
priority, because all interrupts are handled within such a short time that
the next one doesn’t get affected by the latency of other priorities.

This will of course not happen, but I believe the MS initiative to keep
interrupts short is a good one. This will certainly help. Now there’s of
course one problem with this: A system that has LOTS of interrupts, the
scheduling of DPC or some other mechanism to send work off to a lower IRQL
will take a lot of extra time. Not good for overall performance. So someone
will break the rules to improve performance, and we’re back at the beginning
of a “not so ideal world”.

I’m sometimes amazed at what slowness is allowed for interrupts to be
handled in Windows, and the system still runs nicely (i.e. it doesn’t crash
or behave too badly, you may get glitches in sound or video, but that’s it).
It’s very interesting to see how long an interrupt can actually be held
pending. It seems that it is ALMOST FOREVER (in computer time)…

I think the idea of automatically/runtime adjusted interrupts is a fine
idea. It’s just the implementation of the prioritization routine that I have
a hard time figuring how it should work. I would tend to prioritize
interrupts that run short times, and let the longer ones run at lower
priority. That should reduce the average latency. Of course, it’s not good
for the server system where someone copies a 256KB packet of data from the
disk to the main memory inside the interrupt handler, but they shouldn’t be
doing that in the first place, eh? :wink:


Mats


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

>

The best interrupt is no interrupt. Things like AV playback should be
handled 100% on the south side of the bus, no need to involve
the processor
in it. I believe that if you run into performance issues because of
interrupt latency, it’s about time to migrate to a better
architecture !

I suppose this means:

  1. Load one CD’s worth of data into memory.
  2. Lock above memory to not page out.
  3. Set pointer to memory into sound card.
  4. Let sound card play the contents of memory.
  5. When sound card interrupts saying it’s finished, de-allocate the CD’s
    worth of memory and start over.

Or did you want to integrate the file system driver into the sound card, so
that we can read the hard disk via the PCI bus, without involvment of the
CPU in either disk reads or sound playing?

Neither sound like the right thing to do to me…


Mats

Mats commented:

I think the idea of automatically/runtime adjusted interrupts is a fine
idea. It’s just the implementation of the prioritization routine that I
have
a hard time figuring how it should work.

I’ve been thinking about this problem off and on for 30 years, and I still
don’t have a good answer to that one, other than knowing that it involves a
whole lot of simultaneous equations. Whether it involves more variables
than equations isn’t yet clear to me. The more complicated the system
architecture, and the more complicated the workload at any instant, the more
complicated the potential solution. I think you have to live with an
approximate solution. So the question becomes, how well can the approximate
solution(s) work? How much do you really have to solve? Are there some
ideas or tools that we could perhaps easily implement that might make the
solution better than we would at first guess they might?

Loren

> The best interrupt is no interrupt. Things like AV playback should be

handled 100% on the south side of the bus, no need to involve the
processor
in it. I believe that if you run into performance issues because of
interrupt latency, it’s about time to migrate to a better architecture !

Um. Everything is a pipe of some sort or other. Sooner or later you start
having problems with turbulent flow around the corners, or the laminar flows
detatching from the walls.

Saying “just throw it over the wall, that solves all MY problems” may be
true. It doesn’t, however, solve all of the problems with the original
implementation.

For instance, video decoding is complicated enough that the only way it is
going to get done practically on the south side of the bridge is by putting
a reasonably general-purpose processor on the south side of the bridge. And
that processor is going to have to get bits from a source, transform them in
some manner, and push them out to a destination. And the translation is
unlikely to be 1:1, so there have to be flow rate conversions.

Now, you can “solve” the problem, for any specific singular case, by making
the transport into hardware fifos that control the wait-state line to the
processor. Thus making the whole thing synchronous, and the average
processor utilization somewhere around 35% max, and limiting the kinds of
transformations that can be accomplished. This might “eliminate” the
problems of interrupts. But it doesn’t really solve the problem, it just
gives you a problem that is probably worse.

The only way to “eliminate” interrupts is to design a system such that when
peripheral data becomes available to a processing thread, the thread is
scheduled automatically by the hardware. But scheduled doesn’t necessarily
mean run; you still have to get some processor cycles somewhere. And that
might be stealing them from something else that reall wants them too. Which
gets you into priority handling on scheduling and slicing and deciding what
to assign to which piece of hardware, which gets you into cache nearness
considerations and ability to get to the specific hardware.

Which is to say, it solves nothing. You still have all the same problems to
solve, they are just wrapped in a different color ribbon.

Loren

It’s not that bad. Guess where is the bottleneck ? when you want to have
several media stream !. I was put on the spot, and my tail is on fire, but
we do have temporarily non-sharable interesting result(s). We do have some
characterization about who comes first, second etc as bottleneck under
farily
represtative workload and setup, OS is not that bad yet, others are jamming
for
desparate help.

For the publicly available ( a part of the story) could be found on the
recent
computer journal of IEEE.

-prokash

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Moreira, Alberto
Sent: Tuesday, February 17, 2004 6:29 AM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] Re:Interrupt Latency of ACPI vs Standard PC

The best interrupt is no interrupt. Things like AV playback should be
handled 100% on the south side of the bus, no need to involve the processor
in it. I believe that if you run into performance issues because of
interrupt latency, it’s about time to migrate to a better architecture !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@3Dlabs.com
Sent: Tuesday, February 17, 2004 9:21 AM
To: Windows System Software Devs Interest List
Subject: RE: Re:[ntdev] Re:Interrupt Latency of ACPI vs Standard PC

Loren,

Ideally the system should be completely self-tuning and the
user’s options
limited to a single “Go Faster” slider, or more likely push
button, and the
system will read the user’s mind and figure out what he
*really* wants,
since he probably can’t actually express it himself in most
cases. In a
less ideal world, one has to deal with more factors, and not
all of them can
be static if truely optimal performance is the goal.

I think the computer will be very confused if it could read my
mind ;-).
>
> Which gets me to idly wondering about the concept of truely dynamic
> interrupt routing/tuning as part of an adjustable performance
> strategy.
> Processes and threads have adjustable priorities so that the user (or
> someone) can give an indication of relative desires. I start
> wondering if
> it would be reasonable to have interrupt affinity and priority levels
> adjustable dynamically, much like thread priority. If you consider a
> device/driver to be a process, then adjusting its relative
> priority doesn’t
> sound like that strange a concept.

There are many conflicting goals to satisfy here, and the scheduling of
which interrupt gets the highest priority is never going to be
straightforward.

Obviously, a system where you have some sort of real time needs, say AV
playback, will need to have fast enough response-time on the relevant
interrupts to the AV playback. But if you raise the importance of the sound
card, and thus reduce the importance of the hard disk interrupt, you may get
problems to get the data across to the sound card. So although the latency
to the real-time critical part is lower, you’ve missed the goal-post by a
side effect of trying to get to the goal.

[The above is a completely made up example, and just for illustration
purposes. Please change devices around as you please. There is always some
sort of dependancy between one interrupt and another, that may cause things
to go wrong.]

In the ideal world, it shouldn’t really matter which interrupt has what
priority, because all interrupts are handled within such a short time that
the next one doesn’t get affected by the latency of other priorities.

This will of course not happen, but I believe the MS initiative to keep
interrupts short is a good one. This will certainly help. Now there’s of
course one problem with this: A system that has LOTS of interrupts, the
scheduling of DPC or some other mechanism to send work off to a lower IRQL
will take a lot of extra time. Not good for overall performance. So someone
will break the rules to improve performance, and we’re back at the beginning
of a “not so ideal world”.

I’m sometimes amazed at what slowness is allowed for interrupts to be
handled in Windows, and the system still runs nicely (i.e. it doesn’t crash
or behave too badly, you may get glitches in sound or video, but that’s it).
It’s very interesting to see how long an interrupt can actually be held
pending. It seems that it is ALMOST FOREVER (in computer time)…

I think the idea of automatically/runtime adjusted interrupts is a fine
idea. It’s just the implementation of the prioritization routine that I have
a hard time figuring how it should work. I would tend to prioritize
interrupts that run short times, and let the longer ones run at lower
priority. That should reduce the average latency. Of course, it’s not good
for the server system where someone copies a 256KB packet of data from the
disk to the main memory inside the interrupt handler, but they shouldn’t be
doing that in the first place, eh? :wink:


Mats


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Mats commented:

> I think the idea of automatically/runtime adjusted
interrupts is a fine
> idea. It’s just the implementation of the prioritization
routine that I
have
> a hard time figuring how it should work.

I’ve been thinking about this problem off and on for 30
years, and I still
don’t have a good answer to that one, other than knowing that
it involves a
whole lot of simultaneous equations. Whether it involves
more variables
than equations isn’t yet clear to me. The more complicated the system
architecture, and the more complicated the workload at any
instant, the more
complicated the potential solution. I think you have to live with an
approximate solution. So the question becomes, how well can
the approximate
solution(s) work? How much do you really have to solve? Are
there some
ideas or tools that we could perhaps easily implement that
might make the
solution better than we would at first guess they might?

I don’t know the answer to any of the above, but there is a theory in
Real-Time OS’s, called Deadline Scheduling, which is based on the principle
that the task with the nearest deadline gets scheduled. This sort of
solution could potentially be applied to interrupts, with the definition
that the interrupt with the need for the lowest latency gets scheduled
first. But same as with Deadline scheduling, the problem is to know the
“need for lowest latency”… Back at square one, I suppose… :wink:


Mats

Loren