Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Disk Filter Stuck on Recursive Hard Page fault

niraj_jhaniraj_jha Member Posts: 50

Hi Experts ,

I am currently facing an scalability issue in my disk filterdriver for encryption . I am seeing all my read completion threads is stuck when there is recursive Hard pagefault when teh system is heavily loaded . .
As I understand in recent window memory compression , now instead of page its is the Store which is getting written in pagefile.sys in compressed format and it get decompressed
on its read .

what could be the easy way to avoid such recursion . I have increased the number of thread to handle Read Completion for scalable test but will this be an only solution ?

Below is the call stack of all of my stuck thread

nt!KiSwapContext+0x76
nt!KiSwapThread+0x297
nt!KiCommitThreadWait+0x549
nt!KeWaitForSingleObject+0x520
nt!MiWaitForInPageComplete+0xcd
nt!MiIssueHardFault+0x1ad
nt!MmAccessFault+0x3ed
nt!KiPageFault+0x343
nt!RtlDecompressBufferXpressLz+0x40
nt!RtlDecompressBufferEx+0x60
nt!ST_STORE::StDmSinglePageCopy+0x146
nt!ST_STORE::StDmSinglePageTransfer+0xa0
nt!ST_STORE::StDmpSinglePageRetrieve+0x186
nt!ST_STORE::StDmPageRetrieve+0xc1
nt!SMKM_STORE::SmStDirectReadIssue+0x85
nt!SMKM_STORE::SmStDirectReadCallout+0x21
nt!KeExpandKernelStackAndCalloutInternal+0x78
nt!SMKM_STORE::SmStDirectRead+0xad
nt!SMKM_STORE::SmStWorkItemQueue+0x1b4
nt!SMKM_STORE_MGR::SmIoCtxQueueWork+0xce
nt!SMKM_STORE_MGR::SmPageRead+0x168
nt!SmPageRead+0x2e
nt!MiIssueHardFaultIo+0x11f
nt!MiIssueHardFault+0x3ed
nt!MmAccessFault+0x3ed
nt!KiPageFault+0x343
nt!RtlDecompressBufferXpressHuff+0x19c
nt!RtlDecompressBufferEx+0x60
Wof!FileProvDecompressChunks+0x27f
Wof!FileProvReadCompressedOnNewStackExtendedCompletion+0x237
Wof!FileProvReadCompressedCompletionWorker+0x16e
Wof!FileProvReadCompressedCompletion+0x101
FLTMGR!FltpPassThroughCompletionWorker+0x3c2
FLTMGR!FltpPassThroughCompletion+0xc
nt!IovpLocalCompletionRoutine+0x174
nt!IopfCompleteRequest+0x1cd
nt!IovCompleteRequest+0x1bd
nt!IofCompleteRequest+0x17e28b
VerifierExt!IofCompleteRequest_wrapper+0x2e
nt!VerifierIofCompleteRequest+0x10
DiskEncFltr!driverThreadReadCompletion+0x7a
nt!PspSystemThreadStartup+0x55
nt!KiStartSystemThread+0x1c

If I looked the fileobject for this read , it is pagefile.sys and the IRP with thread is also pointing same . so i believe this is a kind of recursive hard pagefault and all my completion thread get stuck one by one.

What could be an optimum size for such store and is the read for store is splited ? Can i pass this to my decryption engine considering the CPU power is more without queuing so that there will not be any such thread deadlock ( Can read completion routing work in < DISPATCH_LEVEL )

Need your suggestions .

Thanks
Niraj Jha

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE