'Windows 10 Driver EvtIoRead callback not scheduled frequently enough
I have inherited a Windows device driver that receives data packets using DMA.
It's been working reliably for years on a 32 bit platform but I've had to port it to a 64 bit platform. In general it works okay when the data rate is relatively low (suggesting the 64 bit porting is okay) but as soon as the data rate goes up, it can't empty the buffer fast enough and the system sitting on the other side of the DMA boundary overflows its buffers.
Having spent some time analyzing the issue, it seems that the call to the EvtIoRead callback (set up with WdfIOQueueCreate) needs to be called at least once every 10ms to keep up but it frequently drifts out to over 60ms. It's like the thread it's running on isn't a high enough priority to bump over threads/processes.
I've tried setting the core affinity for the device driver and setting cores to be 'soft' real-time but none of these approaches have made a difference. The only thing that changed the behavior was setting the priority of the application calling the driver to realtime. Whilst this solved the problem in my (single threaded) test harness, it had no effect on the real application which is a multi-threaded .Net application.
Any ideas about what I could try to get the callback called more regularly? I know I shouldn't be looking for real time performance on Windows but I'm stuck with it; that ship sailed long ago.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
