>
This would seem to indicate that you are not suffering from cumulative
leaks of PTEs. Instead, due to having multiple mappings outstanding at
the same time, you are simply mapping too much memory, consuming all
the available PTEs. How big are the I/Os pending? The default setting
I think allows 10000 system PTEs, so 40K kilobytes (39 MB) can be mapped
into system space. Some of that is used by the kernel (NP pool and the
like). What’s left can easily be exhausted by several multi-megabyte
mappings (or even one big many-megabyte mapping)
The test application slides the buffer size from 1K up to 2M. Each block
size
performs 10,000 transfers, after which transfer rates are calculated and
printed.
You can increase allowed system PTEs, up to 50000, which gives you
about 170 MB to work with, but this is still finite and can
be consumed simply by scaling the number and/or size of the pending I/Os.
When I had this problem, I didn’t really need a pointer to the memory,
so I redesigned my several related drivers to use MDLs alone, without
mapping. If you must see or manipulate the memory (encryption?) then
you must map, and you may have to come up with some sort of throttling
scheme to prevent the massive parallelism that is leading to the crash.
And you’d have to split huge I/Os that could singly require too many PTEs.
Ok, true confessions time. A transfer is a Read/WriteFileEx that passes a
94 byte transport packet to the driver. The Driver is set for DO_DIRECT_IO
so that 94 byte buffer is mapped and locked by the system into
IRP->MdlAddress.
The transport packet contains the control information such as destination
port ID, TARGET/INITIATOR, data buffer pointer and data buffer length that
will be used to build the fibrechannel request block (FcRB). I take the
data buffer pointer and data buffer length and construct an MDL for
constructing the scatter/gather list.
But you’re right … there is nothing I reference in the data buffer, so all
I need is an MDL to lock it down for the DMA transfer and a system address.
The only user buffer access I need is the 94 byte transport packet that I
use
to build the FcRB and pass status and CDB information to the user. That
packet is already MDL backed and accessible at any IRQL. So, I don’t need
the MmProbeAndLockPages, or the MmUnlockPages.
Hmmm, since it’s IoAllocateMdl links it to IRP->MdlAddress->Next, do I need
to call IoFreeMdl, or will that happen when IoCompleteRequest tears down the
IRP?
Gary
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com