CcCoherencyFlushAndPurge wrapper fails when called over the VA range which is partially purged by the mapped page writer (MPW) to reduce memory pressure.
CcCoherencyFlushAndPurge internally calls:
* mmTrimSection: Invalidates PTEs.
* ccFlushCache: Flushes modified pages.
* ccPurgeCacheSection: Moves pages to the free list.
Details:
- FSD works on memory mapped files. Hence, it only handles paging I/O requests.
- CcCoherencyFlushAndPurge works fine as long as there is no intervention from MPW i.e. under zero memory pressure.
- Only CcPurgeCacheSection call within this wrapper fails. Other calls, MmTrimSection and CcFlushCache, always pass.
- We do exclusive locking on files for both MPW and CcCoherencyFlushAndPurge.
Observations:
- _CONTROL_AREA (data section) shows only ?one? mapped view and ?zero? system mapped view.
- No pending IRPs in the system when the failure occurs.
- PFN entries are getting unmapped by MmTrimSection before CcPurgeCacheSection is getting called.
- Memusage does not show any locked pages in the mapped area.
I am struggling with this issue for a long time. Any suggestions?
Thanks,
Prasad