From: Alexander Grigoriev on
I've had my share of troubles because of paged code. The most recent was
paged code in win2008 acpi.sys which happened to be at DISPATCH_LEVEL, when
DriverVerifier marked all such pages non-present because a spinlock was
being acquired by another processor. Happened during DTM test for hot
processor plug simulation.

2GB of RAM costs 50$. 20MB costs $0.50 then. I'm not sure it's worth the
trouble.

"Don Burn" <burn(a)stopspam.windrvr.com> wrote in message
news:eU1W2RLhKHA.1456(a)TK2MSFTNGP06.phx.gbl...
>I have to disagree. The 20MB figure is big even for todays systems, and if
>your driver can potentially be used in an embedded system or similar
>limited then forgetting PAGE sections is a bad idea. I know of a major
>vendor who lost a number of lucrative contracts thanks to this approach.
>In one case a client of mine acquired the sources, and by simple work on
>using PAGE sections produced an overall improvment in their embedded system
>by well over 50%.
>
>
> --
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
> "Alexander Grigoriev" <alegr(a)earthlink.net> wrote in message
> news:%23A2k4NLhKHA.2184(a)TK2MSFTNGP04.phx.gbl...
>> Using paged code is not worth trouble. Unless the code is over 20MB. Save
>> yourself from grief and forget about using PAGE sections.
>>
>> "David F." <df2705(a)community.nospam> wrote in message
>> news:059BB54E-A6FB-477C-A525-368ACAECA83C(a)microsoft.com...
>>> Hi,
>>>
>>> If I have a stoic library built that I want to link and say it's part of
>>> the "PAGE" code segment how do I do that? The library could be used in
>>> either case (non-paged or paged) when I know it's okay to use in PAGE
>>> segment I want to tell the build to make it paged code to not allocate
>>> non-paged pool space for the code.
>>>
>>> Also how exactly does the code_seg with class information work? Can I
>>> provide the segment and class name in the header file or in a .CPP
>>> module and does that make that class always go to that segment even if
>>> that class is compiled to its own static library too?
>>>
>>> TIA!!
>>>
>>>
>>
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4715 (20091224) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4715 (20091224) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>


From: Kalle Olavi Niemitalo on
"David F." <df2705(a)community.nospam> writes:

> If I have a stoic library built that I want to link and say it's part
> of the "PAGE" code segment how do I do that? The library could be
> used in either case (non-paged or paged) when I know it's okay to use
> in PAGE segment I want to tell the build to make it paged code to not
> allocate non-paged pool space for the code.

I suppose you could specify a custom segment name
(e.g. yourlib.text) when building the static library, then use
LINK /MERGE to rename it to PAGETEXT or .text in each driver that
uses the static library. Dunno how to best do that in BUILD.
From: Doron Holan [MSFT] on
it does not quite work that way. by consuming NP pool you take away the
ability to use that memory for anything else. the friendlier you are with
NP pool (e.g. the less you consume), the better the system can respond to
memory pressure. a few megabytes make a huge difference when a machine is
running a lot of apps or is under load

d

--

This posting is provided "AS IS" with no warranties, and confers no rights.


"Alexander Grigoriev" <alegr(a)earthlink.net> wrote in message
news:u#seTjMhKHA.2164(a)TK2MSFTNGP02.phx.gbl...
> I've had my share of troubles because of paged code. The most recent was
> paged code in win2008 acpi.sys which happened to be at DISPATCH_LEVEL,
> when DriverVerifier marked all such pages non-present because a spinlock
> was being acquired by another processor. Happened during DTM test for hot
> processor plug simulation.
>
> 2GB of RAM costs 50$. 20MB costs $0.50 then. I'm not sure it's worth the
> trouble.
>
> "Don Burn" <burn(a)stopspam.windrvr.com> wrote in message
> news:eU1W2RLhKHA.1456(a)TK2MSFTNGP06.phx.gbl...
>>I have to disagree. The 20MB figure is big even for todays systems, and
>>if your driver can potentially be used in an embedded system or similar
>>limited then forgetting PAGE sections is a bad idea. I know of a major
>>vendor who lost a number of lucrative contracts thanks to this approach.
>>In one case a client of mine acquired the sources, and by simple work on
>>using PAGE sections produced an overall improvment in their embedded
>>system by well over 50%.
>>
>>
>> --
>> Don Burn (MVP, Windows DKD)
>> Windows Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>>
>>
>> "Alexander Grigoriev" <alegr(a)earthlink.net> wrote in message
>> news:%23A2k4NLhKHA.2184(a)TK2MSFTNGP04.phx.gbl...
>>> Using paged code is not worth trouble. Unless the code is over 20MB.
>>> Save yourself from grief and forget about using PAGE sections.
>>>
>>> "David F." <df2705(a)community.nospam> wrote in message
>>> news:059BB54E-A6FB-477C-A525-368ACAECA83C(a)microsoft.com...
>>>> Hi,
>>>>
>>>> If I have a stoic library built that I want to link and say it's part
>>>> of the "PAGE" code segment how do I do that? The library could be used
>>>> in either case (non-paged or paged) when I know it's okay to use in
>>>> PAGE segment I want to tell the build to make it paged code to not
>>>> allocate non-paged pool space for the code.
>>>>
>>>> Also how exactly does the code_seg with class information work? Can I
>>>> provide the segment and class name in the header file or in a .CPP
>>>> module and does that make that class always go to that segment even if
>>>> that class is compiled to its own static library too?
>>>>
>>>> TIA!!
>>>>
>>>>
>>>
>>>
>>>
>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>> signature database 4715 (20091224) __________
>>>
>>> The message was checked by ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4715 (20091224) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>>
>
>
From: Alexander Grigoriev on
I don't buy that at all. You know that Vista/2008 doesn't have an explicit
limit on NP pool size anymore. In any case, if you hit NP pool limit, you've
perhaps already hit other bottlenecks, such as IO throughput, etc.

And it doesn't matter if you hit it 20MB earlier or later. If it happens,
your system was already fragile. I don't believe, also that amount of loaded
pageable KM code in a x86 system is any more than 10 MB. Not worth trouble.
These paged code/paged stack bugs happen to be quite obscure and hard to
diagnose.

"Doron Holan [MSFT]" <doron.holan(a)online.microsoft.com> wrote in message
news:OhwzGBXjKHA.4912(a)TK2MSFTNGP02.phx.gbl...
> it does not quite work that way. by consuming NP pool you take away the
> ability to use that memory for anything else. the friendlier you are with
> NP pool (e.g. the less you consume), the better the system can respond to
> memory pressure. a few megabytes make a huge difference when a machine is
> running a lot of apps or is under load
>
> d
>
> --
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "Alexander Grigoriev" <alegr(a)earthlink.net> wrote in message
> news:u#seTjMhKHA.2164(a)TK2MSFTNGP02.phx.gbl...
>> I've had my share of troubles because of paged code. The most recent was
>> paged code in win2008 acpi.sys which happened to be at DISPATCH_LEVEL,
>> when DriverVerifier marked all such pages non-present because a spinlock
>> was being acquired by another processor. Happened during DTM test for hot
>> processor plug simulation.
>>
>> 2GB of RAM costs 50$. 20MB costs $0.50 then. I'm not sure it's worth the
>> trouble.
>>
>> "Don Burn" <burn(a)stopspam.windrvr.com> wrote in message
>> news:eU1W2RLhKHA.1456(a)TK2MSFTNGP06.phx.gbl...
>>>I have to disagree. The 20MB figure is big even for todays systems, and
>>>if your driver can potentially be used in an embedded system or similar
>>>limited then forgetting PAGE sections is a bad idea. I know of a major
>>>vendor who lost a number of lucrative contracts thanks to this approach.
>>>In one case a client of mine acquired the sources, and by simple work on
>>>using PAGE sections produced an overall improvment in their embedded
>>>system by well over 50%.
>>>
>>>
>>> --
>>> Don Burn (MVP, Windows DKD)
>>> Windows Filesystem and Driver Consulting
>>> Website: http://www.windrvr.com
>>> Blog: http://msmvps.com/blogs/WinDrvr
>>>
>>>
>>> "Alexander Grigoriev" <alegr(a)earthlink.net> wrote in message
>>> news:%23A2k4NLhKHA.2184(a)TK2MSFTNGP04.phx.gbl...
>>>> Using paged code is not worth trouble. Unless the code is over 20MB.
>>>> Save yourself from grief and forget about using PAGE sections.
>>>>
>>>> "David F." <df2705(a)community.nospam> wrote in message
>>>> news:059BB54E-A6FB-477C-A525-368ACAECA83C(a)microsoft.com...
>>>>> Hi,
>>>>>
>>>>> If I have a stoic library built that I want to link and say it's part
>>>>> of the "PAGE" code segment how do I do that? The library could be
>>>>> used in either case (non-paged or paged) when I know it's okay to use
>>>>> in PAGE segment I want to tell the build to make it paged code to not
>>>>> allocate non-paged pool space for the code.
>>>>>
>>>>> Also how exactly does the code_seg with class information work? Can I
>>>>> provide the segment and class name in the header file or in a .CPP
>>>>> module and does that make that class always go to that segment even if
>>>>> that class is compiled to its own static library too?
>>>>>
>>>>> TIA!!
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>>> signature database 4715 (20091224) __________
>>>>
>>>> The message was checked by ESET NOD32 Antivirus.
>>>>
>>>> http://www.eset.com
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>> signature database 4715 (20091224) __________
>>>
>>> The message was checked by ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>>
>>
>>


From: Maxim S. Shatskih on
> These paged code/paged stack bugs happen to be quite obscure and hard to
> diagnose.

PREfast and Verifier find most of them.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com