Page it all if it is not being used!
We have several drivers that require some action for large chunks of the
driver to become active. It is a filter and it sits there passive 95% of
the time. We page those chunks out until needed.
Laziness is not excuses…
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jake Oshins
Sent: Sunday, May 05, 2002 1:04 AM
To: NT Developers Interest List
Subject: [ntdev] RE: statically declared variable
Max is right. But it’s worth noting the full syntax. (Perhaps I missed
this in an earlier part of the thread. If so, sorry.)
If you want static data to end up in a particular section, the
constructs I use within the DDK environment look like this:
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg(“INIT”)
#endif
(definitions for static data that can disappear after the end of
DriverEntry)
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg(“PAGE”)
#endif
(definitions for static data that can be paged)
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg(“PAGELK”)
#endif
(definitions for static data that can be paged, but which I will lock
down occasionally, as when the system is about to go to sleep)
#ifdef ALLOC_DATA_PRAGMA
#pragma data_seg()
#endif
(this causes the other directives to be ignored)
In another thread, I think it was Bill who said that he thinks that it’s
not worth ever using pageable memory in a driver, mostly because the
performance benefit is small and the test hassle is large. I agree that
the performance benefit has gotten pretty small as memories have gotten
larger. But I believe the test hassle is also small, as long as you
turn on IRQL Checking in the Driver Verifier.
This feature of the DV will page out all of your pageable allocations,
your pageable code and your pageable static data whenever you’re running
at raised IRQL, which will cause any access to paged data to immediately
fault. If you do your development with this flag enabled, then managing
paged data is actually quite simple.
Just an opinion,
Jake
This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
Subject: Re: statically declared variable
From: “Maxim S. Shatskih”
Date: Sat, 4 May 2002 19:41:18 +0400
X-Message-Number: 7
> some other section with the appropriate attributes. I think it depends
on
> the section’s flags,
No, on section name. If it starts with “PAGE” - then the section is
pageable.
>and I think that by default sections are marked as
> pageable.
As NONpageable.
Max
—
You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
unsubscribe send a blank email to %%email.unsub%%