LatMon, ISR and DPC latency monitor

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi, I'm putting together an ISR and DPC latency monitor using ETW tracing. This tool measures and displays latencies caused by ISR (Interrupt Service Routines)and DPC (Deferred Procedure Calls). While ISRs or DPCs are executing,
the processor on which it runs is stalled in a sense that it cannot perform a
context switch and schedule any normal execution thread until the ISR or
DPC has finished executing. High ISR and DPC latencies will cause your system to become unsuitable for audio processing as buffers need to be processed in a timely manner. This tool displays maximum measured ISR and DPC latencies as well as the drivers to which these routines belong.

There are still a few rough edges as I'm trying to get this ETW stuff right. In case it loses events the reported values may lose their meaning. I'm hoping to receive some feedback and suggestions. Source code of the ETW component is available.

http://www.resplendence.com/latmon
(runs on Vista and later OS only)

//Daniel

Post

Nice software. However, I can't pin it on any driver and basically have to get a new PC now after DPC spikes started turning up with NO CHANGES from my side whatsoever. Let's hope others stumbling upon this thread are more lucky...

Post

oneshotdeal wrote:Nice software. However, I can't pin it on any driver and basically have to get a new PC now after DPC spikes started turning up with NO CHANGES from my side whatsoever. Let's hope others stumbling upon this thread are more lucky...
What do you mean ? You have a DPC spike and LatencyMon does not report it ?

Post

No, it shows USBPORT.sys and ATAPORT.sys as causing the highest DPC, and I can hardly disable those.

I'm on a new PC now and still get DPC spikes, although a lot lower - a maximum of 1000 as opposed to 4000. Since I kept no other parts but the HDDs, I'm suspecting the cause to be Intel's power saving thingy, because every time the CPU has any load, and therefore runs at its maximum clock, the spikes disappear completely. This was the case on my old system as well. I couldn't run videos without crackling noises, but if I let LatMon run in the background (which maxed out CPU), it ran just fine.

Maybe you should work on your program's CPU load? Another DPC latency checker uses pretty much no CPU at all, although I guess it doesn't monitor drivers in real time so I have no idea how realistic this is.

Post

oneshotdeal wrote:No, it shows USBPORT.sys and ATAPORT.sys as causing the highest DPC, and I can hardly disable those.

I'm on a new PC now and still get DPC spikes, although a lot lower - a maximum of 1000 as opposed to 4000. Since I kept no other parts but the HDDs, I'm suspecting the cause to be Intel's power saving thingy, because every time the CPU has any load, and therefore runs at its maximum clock, the spikes disappear completely. This was the case on my old system as well. I couldn't run videos without crackling noises, but if I let LatMon run in the background (which maxed out CPU), it ran just fine.
Yeah it's probably Speedstep (or whatever it's called). You could see if you can disable it in the BIOS if the power saving settings in Windows don't seem to help. On desktops this should usually be fine. On laptops this will waste some battery power so hopefully you can have two windows power profiles (ie allow CPU throttling with battery, disable it with high-performance profile or when running on AC).

Post

You may be able to get better results if you disable certain CPU power management features in Windows. You may have to disable C-states in your BIOS setup for better results or disable Speedstep altogether. The reason why these CPU power features cause such long stalls is not exactly known. If you have a first generation intel core i7 you might be hitting one of the many CPU bugs, there is a long list of errata and most of these bugs seem related to C- and P states and can cause a CPU to stall for an indifinite period of time until certain conditions are met. Another explanation may be that you are hitting SMI (system management interrupts) routines. This is BIOS code executing at the highest priority level (with all interrupts disabled) beyond the control of the OS. These may be related to power management, to work around certain hardware bugs or otherwise. I'm working on LatencyMon to get it to make more sense of unexplainable CPU stalls.

You are right about the CPU consumption, the reason for this is that the software pumps around thousands if not millions of events per second because it is equipped to display them in real-time. Version 3 will see the light in a few weeks and is equipped to analyze events at a lower level and drop them much earlier, resulting in lower CPU usage making it less probable that it obfuscates any existing problems.

Post Reply

Return to “DSP and Plugin Development”