Hi

I was wondering if there is a way to tell the kernel to not page a specific
application.

I have read this article
http://blogs.msdn.com/ce_base/archive/2008/01/19/Paging-and-the-Windows-CE-Paging-Pool.aspx

And, it suggests a method for making all applications non-pageable or a
method for making a section or sections of a specific application
non-pageable.

I have tried the first method, but I find that the system memory consumption
is too high.

The second method may be acceptable, but I would perfer to make the entire
application non-pageable instead of doing this by sections.

Is there a method for doing this?

Thank you,

Tom

RE: Making an application non-pageable by CL

CL
Tue Aug 19 19:02:08 PDT 2008

You can set the 'M' flag of the binary image builder (.bib) file to force
your application into an non-pageable mode.

for example,
app.exe $(_FLATRELEASEDIR)\app.exe NK SHM

For the section non-pageable, you can refer to the codes below.

/***************************************/
#pragma comment(linker, "/section:.no_page,ER!P")
#pragma code_seg(push, ".no_page")
XXX_PowerDown()
{ //Perform single-threaded power off logic }
XXX_PowerUp()
{ //Perform single-threaded power on logic }
#pragma code_seg(pop)
/***************************************/

"Tom K" wrote:

> Hi
>
> I was wondering if there is a way to tell the kernel to not page a specific
> application.
>
> I have read this article:
> http://blogs.msdn.com/ce_base/archive/2008/01/19/Paging-and-the-Windows-CE-Paging-Pool.aspx
>
> And, it suggests a method for making all applications non-pageable or a
> method for making a section or sections of a specific application
> non-pageable.
>
> I have tried the first method, but I find that the system memory consumption
> is too high.
>
> The second method may be acceptable, but I would perfer to make the entire
> application non-pageable instead of doing this by sections.
>
> Is there a method for doing this?
>
> Thank you,
>
> Tom

RE: Making an application non-pageable by TomK

TomK
Wed Aug 20 07:04:02 PDT 2008

Thanks for the tip about the bib file, but unfortunately that method won't do
either. We build and release our kernel seperately from the applications
that actually run on our platform. Updating the kernel in our device is not
easy (and extremely time consuming).

Is there another way of telling the system to not page an exe? Perhaps a
registry entry that tells the loader to not page?


"C.L" wrote:

> You can set the 'M' flag of the binary image builder (.bib) file to force
> your application into an non-pageable mode.
>
> for example,
> app.exe $(_FLATRELEASEDIR)\app.exe NK SHM
>
> For the section non-pageable, you can refer to the codes below.
>
> /***************************************/
> #pragma comment(linker, "/section:.no_page,ER!P")
> #pragma code_seg(push, ".no_page")
> XXX_PowerDown()
> { //Perform single-threaded power off logic }
> XXX_PowerUp()
> { //Perform single-threaded power on logic }
> #pragma code_seg(pop)
> /***************************************/
>
> "Tom K" wrote:
>
> > Hi
> >
> > I was wondering if there is a way to tell the kernel to not page a specific
> > application.
> >
> > I have read this article:
> > http://blogs.msdn.com/ce_base/archive/2008/01/19/Paging-and-the-Windows-CE-Paging-Pool.aspx
> >
> > And, it suggests a method for making all applications non-pageable or a
> > method for making a section or sections of a specific application
> > non-pageable.
> >
> > I have tried the first method, but I find that the system memory consumption
> > is too high.
> >
> > The second method may be acceptable, but I would perfer to make the entire
> > application non-pageable instead of doing this by sections.
> >
> > Is there a method for doing this?
> >
> > Thank you,
> >
> > Tom

RE: Making an application non-pageable by CL

CL
Wed Aug 20 20:58:05 PDT 2008

Do you have the source codes of the application?
If yes, you can add the pre-compile instructions as below to make your
application non-pageable.

#pragma comment(linker, "/section:.no_page,ER!P")
#pragma code_seg(push, ".no_page")
/// Application source codes.
#pragma code_seg(pop)

"Tom K" wrote:

> Thanks for the tip about the bib file, but unfortunately that method won't do
> either. We build and release our kernel seperately from the applications
> that actually run on our platform. Updating the kernel in our device is not
> easy (and extremely time consuming).
>
> Is there another way of telling the system to not page an exe? Perhaps a
> registry entry that tells the loader to not page?
>
>
> "C.L" wrote:
>
> > You can set the 'M' flag of the binary image builder (.bib) file to force
> > your application into an non-pageable mode.
> >
> > for example,
> > app.exe $(_FLATRELEASEDIR)\app.exe NK SHM
> >
> > For the section non-pageable, you can refer to the codes below.
> >
> > /***************************************/
> > #pragma comment(linker, "/section:.no_page,ER!P")
> > #pragma code_seg(push, ".no_page")
> > XXX_PowerDown()
> > { //Perform single-threaded power off logic }
> > XXX_PowerUp()
> > { //Perform single-threaded power on logic }
> > #pragma code_seg(pop)
> > /***************************************/
> >
> > "Tom K" wrote:
> >
> > > Hi
> > >
> > > I was wondering if there is a way to tell the kernel to not page a specific
> > > application.
> > >
> > > I have read this article:
> > > http://blogs.msdn.com/ce_base/archive/2008/01/19/Paging-and-the-Windows-CE-Paging-Pool.aspx
> > >
> > > And, it suggests a method for making all applications non-pageable or a
> > > method for making a section or sections of a specific application
> > > non-pageable.
> > >
> > > I have tried the first method, but I find that the system memory consumption
> > > is too high.
> > >
> > > The second method may be acceptable, but I would perfer to make the entire
> > > application non-pageable instead of doing this by sections.
> > >
> > > Is there a method for doing this?
> > >
> > > Thank you,
> > >
> > > Tom

RE: Making an application non-pageable by TomK

TomK
Tue Aug 26 11:13:09 PDT 2008

I guess the pragma method is the only way. I do have the source, but I was
hoping to avoid doing this as the source is spread across many files.

Thanks for the help.

RE: Making an application non-pageable by TomK

TomK
Tue Aug 26 11:15:02 PDT 2008

Also, another thought just occurred to me...

If the process that I am trying to make non-pageable calls code in a dll
then how can I guarantee that that code is not paged?

I assume that the answer is to recompile any dlls that the process uses as
well?

Re: Making an application non-pageable by Paul

Paul
Tue Aug 26 11:39:34 PDT 2008

You can load a DLL using LoadDriver, rather than LoadLibrary, and that will
assure that you can make it non-pageable. In fact, that's what I'd do for
the whole problem. Have the application EXE be only stuff that can be
paged. Load DLLs for everything else.

By the way, I don't see where you told us what version of CE we're talking
about...

Paul T.

"Tom K" <TomK@discussions.microsoft.com> wrote in message
news:30B561C2-C4AE-4C68-8F02-B96A5078BE73@microsoft.com...
> Also, another thought just occurred to me...
>
> If the process that I am trying to make non-pageable calls code in a dll
> then how can I guarantee that that code is not paged?
>
> I assume that the answer is to recompile any dlls that the process uses as
> well?