KeSetevent() from kmdf driver DPC @ IRQL_DISPATCH taking from 40uS - 600+ uS RRS feed

  • Question

  • I have a kmdf driver that sets one of four events created in user space and mapped to kernel space via 

    ObReferenceObjectByHandle(pEvt,SYNCHRONIZE,ExEventObjectType, UserMode, (PVOID*)&pResetRequestEvent, NULL).

    The mapped events are set in the kmdf driver using:


    on a DPC running at IRQL_DISPTACH.  99.5% of the time, the call to KeSetEvent() takes ~42uS to run. .4% of the time the call takes > 300uS, and 3 times in a 3 second run it took > 600uS.

    On the user side, a thread loops on WaitForMultipleObjects() processing any of the events that get signaled.  Cycle-wise, the processing of all of the events is very similar

    My question is:

    Why is the DISPATCH_LEVEL thread's execution time dependent on something happening in user mode?  Is it sometimes entering the scheduler and taking 600+uS? If so, might I be able to change the affinity of the DPC so that it doesn't get stuck behind the scheduler?  

    Keep in mind also that I am NOT talking about DPC latency.  I am measuring and referring ONLY to the call to KeSetEvent().

    Any advice greatly appreciated!

    • Edited by Wade_Dawson Monday, February 9, 2015 3:07 AM
    Monday, February 9, 2015 3:05 AM


All replies