DPC timeout

Hi All,

I am debugging an issue related to DPC timeout. When I run “running -it” command on the dump file, I see the current running thread’s stack on most of the processors are waiting for custom shared lock except one thread that is currently holding the shared lock. I assume the “KeAcquireInStackQueuedSpinLock” function raises the IRQL to dispatch and then wait for the lock object in “KxWaitForLockOwnerShip”.

This is my question. Raising the IRQL to DISPATCH_LEVEL (internally by the function KeAcquireInStackQueuedSpinLock) and waiting prolonged time for the custom lock will cause the DPC timeout. What is the purpose of “KeYieldProcessorEx” function here. It allows the system to reset DPC or something.

nt!KeYieldProcessorEx+0x2
nt!KxWaitForLockOwnerShip+0x2a
nt!KeAcquireInStackQueuedSpinLock+0x7f

Thanks,
Parsa

What is the purpose of “KeYieldProcessorEx” function here.

For the fun of doing it, I just googled KeYieldProcessorEx() . The very first link that I got was the following one

https://answers.microsoft.com/en-us/windows/forum/all/dpcwatchdogviolation-on-new-pc/a3de25aa-6303-406c-a058-b152f5196df8

It describes a problem that is quite similar to yours, but, unlike you, the poster provides the dump of the whole call stack up to the very end,
i.e. to KeBugCheckEx(). Judging from this dump,what KeYieldProcessorEx() does is simply calling the code that actually dispatches interrupts
and calls ISRs

Anton Bassov

Mostly just executes the PAUSE instruction. May also call the hypervisor if it’s spinning too long (HvCallNotifyLongSpinWait)

REP NOP to allow the CPU to power down if it sees fit

if you want more help, share the implementation of the custom lock as I suspect that’s where the problem lies (with no actual information, so I could be totally wrong)