I am thinking of using KeGetCurrentIrql() to decide whether I use
KeAcquireSpinLock() or KeAcquireSpinLockAtDpc(). I am not sure if I should
bother to do this or simply always use KeAcquireSpinLock(). Is the
performance be considerable to use conditional KeAcquireSpinLockAtDpc() ?
Thanks,
Raj
It would be really unlikely that changes from KeAcquireSpinLock to
KeGetCurrentIrql/KeAcquireSpinLock|KeAcquireSpinLockAtDpc would have
any performance improvement. Likely the call to KeGetCurrentIrql is as
expensive as calling KeAcquireSpinLock when actually at dispatch.
Use KeAcquireSpinLockAtDpc when you _know_ you are being called at
dispatch by the callback definition.
Thomas F. Divine
http://www.pcausa.com
In Win2008, KeRaiseIrql and KeGetCurrentIrql() are very inexpensive. You're
not likely to get much performance gain.
"Raj" <R...@discussions.microsoft.com> wrote in message
news:8611CC23-B6C0-42BC...@microsoft.com...
Optimizations such as the one you are proposing will affect the total
throughput only if the code path is under high contention.
Otherwise, the general rule is to improve the design to get better
performance and not depend on micro-optimizations.
Regards,
UV
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Uv" <yuv...@gmail.com> wrote in message
news:70050799-892a-4bfd...@h11g2000prf.googlegroups.com...
In these places, use KeRaiseIrql and the KeAcquireSpinLockAtDpcLevel.
In usual places, use KeAcquireSpinLockAtDpcLevel alone.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
1) if you know you are at dispatch level, the AtDpc version will be faster
b/c there is no IRQL get and possible set.
2) otherwise, if you do no not know for sure, just call KeAcquireSpinLock.
internally it will call KeGetCurrentIrql to know if it needs to raise to
dispatch level, so if you check for current irql first and you are at
passive level, you get worse performance b/c KeGetCurrentIrql is called
twice
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Raj" <R...@discussions.microsoft.com> wrote in message
news:8611CC23-B6C0-42BC...@microsoft.com...