3GB and MmGetSystemAddressForMdl

Under certain circumstances, MmGetSystemAddressForMdl is failing with a 3GB
switch on Windows 2003 Server in my legacy kernel mode driver.

Before I go into it more, does anyone have any recommendations of things to
look at?

Thanks.

Lack of address space, perhaps? /3GB severely constrains the (already very
limited) available kernel address space.

Ken Johnson (Skywing)
Windows SDK MVP
http://www.nynaeve.net
“Neil Weicher” wrote in message news:xxxxx@ntfsd…
> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>
> Before I go into it more, does anyone have any recommendations of things
> to look at?
>
> Thanks.
>
>

Thanks - that is what initially comes to mind. I am currently invoking it
in DISPATCH_LEVEL. Is more or less likely to succeed if called from
APC_LEVEL or even PASSIVE_LEVEL (or no difference)?

----- Original Message -----
From: “Skywing”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, November 21, 2006 4:02 PM
Subject: Re:[ntfsd] 3GB and MmGetSystemAddressForMdl

> Lack of address space, perhaps? /3GB severely constrains the (already
> very limited) available kernel address space.
>
> –
>
> Ken Johnson (Skywing)
> Windows SDK MVP
> http://www.nynaeve.net
> “Neil Weicher” wrote in message news:xxxxx@ntfsd…
>> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
>> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>>
>> Before I go into it more, does anyone have any recommendations of things
>> to look at?
>>
>> Thanks.
>>

How ‘big’ is the Mdl, oh say the byte count, put another way how long a run
of system address space are you asking for? I’m interested in your case.

“Neil Weicher” wrote in message news:xxxxx@ntfsd…
> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>
> Before I go into it more, does anyone have any recommendations of things
> to look at?
>
> Thanks.
>
>

In blocks of (up to) 64K, but very transient. I am locking down the
application’s read buffer which can be passed via MDL. I am thinking of
having a retry in a kernel thread, but I doubt that kernel space would be
cleared up that quickly.

Thanks for any thoughts.

----- Original Message -----
From: “Lyndon J. Clarke”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, November 21, 2006 4:44 PM
Subject: Re:[ntfsd] 3GB and MmGetSystemAddressForMdl

> How ‘big’ is the Mdl, oh say the byte count, put another way how long a
> run of system address space are you asking for? I’m interested in your
> case.
>
> “Neil Weicher” wrote in message news:xxxxx@ntfsd…
>> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
>> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>>
>> Before I go into it more, does anyone have any recommendations of things
>> to look at?
>>
>> Thanks.
>>
>>

Hi Neil

So 64KB isnt enormous you’d think eh? I wonder …what is the application?
… the MDL should have received ProbeAndLock before it reaches you? …
does the application ‘read’ succeed in the file system?

Cheers
Lyndon
“Neil Weicher” wrote in message news:xxxxx@ntfsd…
> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>
> Before I go into it more, does anyone have any recommendations of things
> to look at?
>
> Thanks.
>
>

I think the reason is fragmentation of the system VA space.
There is no difference whether you call MmGetSystemAddressForMd at DISPATCH
or PASSIVE IRQL. If there is a lack of so called system PTEs( PTEs that are
used to map the page frames in the system address space ) or there is no
large enough VA space frame then you must unmap something to free some
system PTEs.


Slava Imameyev, xxxxx@hotmail.com

“Neil Weicher” wrote in message news:xxxxx@ntfsd…
> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>
> Before I go into it more, does anyone have any recommendations of things
> to look at?
>
> Thanks.
>
>

It is from an IRP_MJ_READ, so that is why I say up to 64K.

It is the MDL in Irp->MdlAddress, not an MDL created by me for the user
buffer (haven’t seen a problem with that).

Yes, the read has already successfully completed.

Thanks for any suggestions.

----- Original Message -----
From: “Lyndon J. Clarke”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, November 21, 2006 5:38 PM
Subject: Re:[ntfsd] 3GB and MmGetSystemAddressForMdl

> Hi Neil
>
> So 64KB isnt enormous you’d think eh? I wonder …what is the application?
> … the MDL should have received ProbeAndLock before it reaches you? …
> does the application ‘read’ succeed in the file system?
>
> Cheers
> Lyndon
> “Neil Weicher” wrote in message news:xxxxx@ntfsd…
>> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
>> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>>
>> Before I go into it more, does anyone have any recommendations of things
>> to look at?
>>
>> Thanks.
>>
>>
>
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@netlib.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

So, it seems improbable then, that the FSD has done
MmGetSystemAddressForMdl[…] with this MDL?

“Neil Weicher” wrote in message news:xxxxx@ntfsd…
> It is from an IRP_MJ_READ, so that is why I say up to 64K.
>
> It is the MDL in Irp->MdlAddress, not an MDL created by me for the user
> buffer (haven’t seen a problem with that).
>
> Yes, the read has already successfully completed.
>
> Thanks for any suggestions.
>
> ----- Original Message -----
> From: “Lyndon J. Clarke”
> Newsgroups: ntfsd
> To: “Windows File Systems Devs Interest List”
> Sent: Tuesday, November 21, 2006 5:38 PM
> Subject: Re:[ntfsd] 3GB and MmGetSystemAddressForMdl
>
>
>> Hi Neil
>>
>> So 64KB isnt enormous you’d think eh? I wonder …what is the
>> application?
>> … the MDL should have received ProbeAndLock before it reaches you? …
>> does the application ‘read’ succeed in the file system?
>>
>> Cheers
>> Lyndon
>> “Neil Weicher” wrote in message news:xxxxx@ntfsd…
>>> Under certain circumstances, MmGetSystemAddressForMdl is failing with a
>>> 3GB switch on Windows 2003 Server in my legacy kernel mode driver.
>>>
>>> Before I go into it more, does anyone have any recommendations of things
>>> to look at?
>>>
>>> Thanks.
>>>
>>>
>>
>>
>>
>> —
>> Questions? First check the IFS FAQ at
>> https://www.osronline.com/article.cfm?id=17
>>
>> You are currently subscribed to ntfsd as: xxxxx@netlib.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>
>