Hello All,
The problem that I am having is that I seem to be running out of PTE’s on my
system. Basically, I am getting a bunch of User-Land buffers that I want to
copy data into from the driver. I use IoAllocateMdl, MmProbeAndLockPages
and MmGetSystemAddressForMdlSafer (was posted by Walter Oney if I am not
mistaken, it basically uses MmGetSystemAddressForMdl but allows it to fail.)
Well, what I am seeing is the driver is repeatable failing in the call to
MmGetSystemAddressForMdlSafe, and if I use MmGetSystemAddressForMdl the
PC will BSOD with NO_MORE_PTES.
I read that the number of PTE’s that are available can be changed by changing
the Registry at HKEY_LOCAL_MACHINE/System/Current…/SystemPages which was
set to 0x63000 (Microsoft’s web says to change it to 40000 (<=128) or to
change it to 110000 for (128-256MB) of ram in your system. Even Changing
the value of the Registry Key did not change the fact that it was running
out of PTE’s.
Now the ammount that gets mapped to system space can vary and can be in as
large chunks as 6291456 bytes however it is failing on the 4th try to
map in a user space buffer of size 25165824 bytes (the first 3 have already
succeeded) and the largest chunk of size 6291456 can be mapped in on its
own (I haven’t tried to see how many times it can be mapped in.)
Basically, when I am done with the user buffer, I unmap it and the userapp
should then send down another. This works fine with most cases, just not
when I get 4 25165824 byte buffers (well trying to.)
Is that size really TOO much data to try and map? I could understand if
I was trying to allocate that much for usage, but I am not. Does anyone
know what I can do to get this to work short of keeping track of how many
I can mapped in and maybe keeping a queue of user buffers that are
waiting to be mapped in (So we have 4 buffers yet only 2 are actually
mapped in, and buffers from this queue get mapped in as we are done with
others.)
PS. The driver will have allocated a total of 2764800 bytes as its own
internal buffer from the non-paged pool (although it is done as smaller
segments for other uses.)
Thanks for your help.
Brad.