Handling asynchronous paging I/O requests from VMM

In FSD, I am getting asynchronous paging I/O requests from VMM’s mapped page writer.
Should I use (I/O manager’s) IoCompleteRequest for such requests or is there any other way to report VMM about I/O completion?

Here are more details,

When I am trying to purge a memory mapped file using CcCoherencyFlushAndPurgeCache, the call is failing with STATUS_CACHE_PAGED_LOCK. The meaning of this error is that pages are locked in the memory for I/O.

In FSD, I see asynchronous paging I/O requests from VMM’s mapped paged writer. Currently, I am processing these requests synchronously. I do execute IoCompleteRequest to destroy mdl and free the locked pages. Still, I am seeing this failure.

Under no memory pressure i.e. when memory mapped writer is not invoked, FSD works fine.

I see that mapped writer is waiting on some _KEVENTS. SO, I am suspecting VMM is either not releasing locks or these events due to queued IRPs (VMM has already acquired PFN locks for them) which are waiting for FSD to service them.

THREAD fffffa8006d837c0 Cid 0004.0088 Teb: 0000000000000000 Win32Thread: 0000000000000000 WAIT: (WrFreePage) KernelMode Non-Alertable
fffff8000348d9a0 SynchronizationEvent
fffff8000348d9b8 SynchronizationEvent
fffff8000348d9d0 SynchronizationEvent
fffff8000348d9e8 SynchronizationEvent
fffff8000348da00 SynchronizationEvent
fffff8000348da18 SynchronizationEvent
fffff8000348da30 SynchronizationEvent
fffff8000348da48 SynchronizationEvent
fffff8000348da60 SynchronizationEvent
fffff8000348da78 SynchronizationEvent
fffff8000348da90 SynchronizationEvent
fffff8000348daa8 SynchronizationEvent
fffff8000348dac0 SynchronizationEvent
fffff8000348dad8 SynchronizationEvent
fffff8000348daf0 SynchronizationEvent
fffff8000348db08 SynchronizationEvent
fffff8000348db20 SynchronizationEvent
Not impersonating
DeviceMap fffff8a000006100
Owning Process fffffa8006cbab30 Image: System
Attached Process N/A Image: N/A
Wait Start TickCount 10056 Ticks: 734 (0:00:00:11.450)
Context Switch Count 294 IdealProcessor: 4
UserTime 00:00:00.000
KernelTime 00:00:12.932
Win32 Start Address nt!MiMappedPageWriter (0xfffff800032f9b18)
Stack Init fffff880035ccc70 Current fffff880035cc640
Base fffff880035cd000 Limit fffff880035c7000 Call 0
Priority 17 BasePriority 8 UnusualBoost 0 ForegroundBoost 0 IoPriority 2 PagePriority 5