CPU locked by KeQueryPerformanceCounter()

Hi, everyone.

I got a problem when I counted DMA transferring rate.

When I was using the function KeQueryPerformanceCounter() after starting up
DMA transfer in driver, the transferring rate became faster than not using
this function.(counting the transfer rate on APP, but for debuging, checking
the CPU timing on driver using KeQueryPerformaceCounter. )

It was said the when using this function in kenerl mode, maybe the CPU was
locked by this function. But I could not find some information to support
this opinion. Who can help me?

Best regards,
Thanks.

Ryu wrote:

When I was using the function KeQueryPerformanceCounter() after starting
up DMA transfer in driver, the transferring rate became faster than not
using this function.(counting the transfer rate on APP, but for
debuging, checking the CPU timing on driver using
KeQueryPerformaceCounter. )

Well, first I want to be sure that you understand that the
implementation of KeQPC() is system dependent. On SOME systems it might
result in an RDTSC instruction, for example. On others, it might query
a hardware-based timer which may or may not require the acquisition of a
system-wide spinlock.

I can’t imagine how any of these activities could make your DMA run
FASTER. And I don’t know what you mean by “lock the CPU”.

Can you help with some more details, please? HOW MUCH faster are we
talking about, have you tried this on multiple types of systems (AMD64,
x86 uniprocessor, x86 multiprocessor) and gotten the same results, and
what do you mean by “lock the CPU” and what’s the theory behind why this
would make your DMA faster?

Peter
OSR