I found that MiMappedPageWriter may stop working when a thread called FltClose and FltClose is waiting to acquire the PagingIoResource exclusively.
Is it because FltClose disables Normal APCs? And I wonder why Mapped Page Writer does not disables Normal APCs during its operation?
It seems that MiMappedPageWriter just stop working and it is not because of FltClose.
With the following output from !locks, does anyone has ideas about why MiMappedPageWriter stop working?
kd> !locks
**** DUMP OF ALL RESOURCE OBJECTS ****
KD: Scanning for held locks…
Resource @ 0x8916e6f0 Shared 1 owning threads
Contention Count = 1
Threads: 89656c68-01<*>
KD: Scanning for held locks…
Resource @ 0x890f22c0 Shared 1 owning threads
Threads: 896d2b33-01<*> *** Actual Thread 896d2b30
3070 total locks, 2 locks currently held
kd> !thread 89656c68
THREAD 89656c68 Cid 0004.0064 Teb: 00000000 Win32Thread: 00000000 WAIT: (WrVirtualMemory) KernelMode Non-Alertable
805590a0 NotificationEvent
Not impersonating
DeviceMap e1004428
Owning Process 0 Image:
Attached Process 896d3830 Image: System
Wait Start TickCount 22274 Ticks: 3429 (0:00:00:53.578)
Context Switch Count 110
UserTime 00:00:00.000
KernelTime 00:00:01.328
Start Address nt!MiMappedPageWriter (0x8050c928)
Stack Init bad38000 Current bad37d24 Base bad38000 Limit bad35000 Call 0
Priority 17 BasePriority 8 PriorityDecrement 0 DecrementCount 0
ChildEBP RetAddr Args to Child
bad37d3c 80501cd6 89656cd8 89656c68 804fad62 nt!KiSwapContext+0x2e (FPO: [Uses EBP] [0,0,4])
bad37d48 804fad62 806d32d0 805590b0 00000000 nt!KiSwapThread+0x46 (FPO: [0,0,0])
bad37d70 8050c97d 00000000 00000012 00000000 nt!KeWaitForSingleObject+0x1c2 (FPO: [Non-Fpo])
bad37dac 805c7160 00000000 00000000 00000000 nt!MiMappedPageWriter+0x55 (FPO: [Non-Fpo])
bad37ddc 80542dd2 8050c928 00000000 00000000 nt!PspSystemThreadStartup+0x34 (FPO: [Non-Fpo])
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16