The big change here is that it eliminates the use of APC_LEVEL for
normal mutexes and fast mutexes but still blocks ALL APCs.
The disadvantage of using IRQL APC_LEVEL is that it required
reprogramming the CPU Task Priority Register (TPR) that is used for
routing interrupts in the I/O APIC on an MP system. By eliminating
this, it improves performance of the system. Thus, the OS folks decided
to introduce a new synchronization mechanism that blocks ALL APCs but
leaves the IRQL at PASSIVE_LEVEL.
There are two reasons this hits us in file systems:
(1) We’ve all learned that you can’t call ZwXxx files to perform I/O at
APC_LEVEL. However, the docs say you can do so at PASSIVE_LEVEL. But
that is no longer true - you can only do it at PASSIVE_LEVEL if special
kernel APCs are not disabled. Of course, currently there is no way to
test and see if special kernel APCs are disabled.
(2) Mm has changed much of its code to use guarded mutexes rather than
fast mutexes. Thus, paging I/O operations no longer arrive at APC_LEVEL
but rather at PASSIVE_LEVEL.
We have seen several deadlocks that arise as a result of this in drivers
that have code to detect APC_LEVEL and defend against it do not have
code to detect the blocking of special kernel APCs.
Currently, the only call is KeAreApcsDisabled and this returns TRUE even
if only kernel APCs are disabled
(KeEnterCriticalRegion/FsRtlEnterFileSystem has been called) but not
special kernel APCs.
I hope this helps.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Steve Dispensa
Sent: Thursday, September 30, 2004 7:38 AM
To: ntfsd redirect
Subject: [ntfsd] Guarded Mutexes
Scott Noone pointed out to me the fact that guarded mutexes are used in
2k3 (described here: http://www.osronline.com/article.cfm?article=283).
After thinking about it and discussing it with a couple of folks, I’m
convinced that I don’t understand what the change was for. Can anyone
shed some light on the relative benefits of using guarded mutexes?
Thanks.
-sd
Steve Dispensa
MVP - Windows DDK
www.kernelmustard.com
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com