Hi,
I have a stack of drivers with a very high rate of data streaming, when I run the data processing on passive level the driver behavior become broken but when I do it on DPC level I?m getting 133 BSOD during system WHCK.
Using driver version that do the processing on passive I see problems also when I increase CPU loading (same problems). I tried to analyze the problem and saw that the function that runs on passive doesn?t get enough CPU time. My first assumption was that almost all CPU time is used for ISRs and DPCs but surprisingly perfmon refute it.
I don?t know how to progress with it.
Any idea?
Is there any way to increase the priority of my driver?
How could I understand better why my passive function doesn?t get enough CPU time? How can I identify who use the CPU most of the time?
Thanks, C.S
VTune: Was good in its day. Now it’s pretty dated.
You have a multi-faceted question. Kinda hard to answer in a forum.
Have you looked at Windows Performance Toolkit? It’s pretty complicated, but it might give you an idea of what’s going on in your system… if it really is profiling that you want.
It sounds to me like you have more of an architectural issue, though. You’re never going to be able to avoid SOME system being very busy, and not having enough time for IRQL PASSIVE_LEVEL threads to run, if they’re running at standard scheduling levels.
There are lots and lots of ways to address your issue. You can create your own thread pool and adjust the base scheduling priority of the threads running in it. This can be tricky, because you don’t want to block system level worker threads (in general, I’d recommend going no higher than, say, priority 13… but that’s a super simplification).
You can do part or all of your processing at IRQL DISPATCH_LEVEL. You said you tried this and you’re getting crashes. It’s not clear if these crashes are due to the fact that your code is broken, or if you’re doing something at elevated IRQL that you have to do at IRQL PASSIVE_LEVEL.
Most likely, your best solution will combine some processing at DISPATCH_LEVEL and some processing at IRQL PASSIVE_LEVEL.
Whatever you do, fixing this is NOT likely to be a trivial task. You might be able to make the symptom of the problem go away by throwing a simple fix in. But REALLY getting your driver to work properly is likely to be a matter of re-designing your driver…