Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

DPC watchdog timeout

TimberTimber Member Posts: 26

Hi everybody,
I have been getting DPC watchdog timeouts every now and then and I really need to fix that.
I have benchmarked my DPC routine with KeQueryPerformanceCounter(NULL) around everything and it seemed that I am holding a lock for too long.
Ok, so I put all the processing code into its own driver thread and signal from the DPC via semaphores what task needs to be processed, which is then performed in the thread outside the DPC.
I call KeReleaseSemaphore for all the different items and left the benchmarking in there around each call.
It's all working pretty well, but quite often I get a time period of ~100us between two KeReleaseSemphore calls which is obviously way too much for not doing anything but calling KeReleaseSemaphore.

Should I not be using semaphores for this kind of thing?
In some other thread I saw that someone was actually having issues with the DMA (PutScatterGatherList) which was unrelated to their DPC but hanging the CPU for too long and triggered a DPC timeout bugcheck pointing to their DPC and nothing to do with DMA.
I am processing the DMA interrupts the same way (a separate thread); the thread waits for a semaphore being released in the DPC. Also working really well usually.

Their workaround was to move from DMA Adapter v2 to v3, but I am using KMDF (v1.11) and don't even know which DMA adapter version that creates for me. Not even sure if that's a possibility for my DPC timeouts.

Any pointers would be much appreciated, thanks.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 2 August 2021 Live, Online
Kernel Debugging 27 Sept 2021 Live, Online