I'm working on a device that has NAND, so no XIP. Unfortunately, at
this point, the FMD for the NAND is extremely slow, with a maximum
throughput of around 2.5MB/s, and optimizing it is not an option (for
non-technical reasons at this point). Because it is so slow -
application startup and paging operations are very slow (relative to
similar devices).

Because of this, I'm looking for some ways to make critical
applications XIP out of RAM. At the lowest level conceptually - at boot
time I want critical applications and DLLs copied into RAM so they
don't have to be demand paged from the slow FLASH. Has anyone tried
this - any helpful hints on how to accomplish - or other thoughts?

Thanks,
-Chris

Re: Forcing Application to RAM without Paging by Steve

Steve
Tue Feb 07 21:22:52 CST 2006

Just disable paging in the registry profile for the NAND flash and it will
always run from FULL RAM.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: Forcing Application to RAM without Paging by Chris

Chris
Tue Feb 07 22:05:09 CST 2006

Steve, thanks for the response. If I understand your suggestion
correctly, that will protect me from slowness of paging, but it won't
help the startup time of applications, right? I'm trying to solve both
problems - that's why I thought if there was a way to XIP from RAM (and
based on your suggestion, combine that with disabling paging), then
apps will load fast and switch fast.

-Chris


Re: Forcing Application to RAM without Paging by Steve

Steve
Wed Feb 08 10:30:27 CST 2006

If you don't XIP from ROM/FLASH the code MUST be loaded to ram at some
point. I've never noticed a significant performance hit for loading an
application with paging turned off. It's usually more of a memory resource
issue. If memory gets full the system can't discard code pages. We set up
all removal storage devices to disable paging so that applications continue
to function when the media they are loaded from is removed.

Exactly what are you calling "startup time" in this context, time to lad a
single EXE or time from power on reset to usability by end user? those are
two completely different things with different things impacting them.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: Forcing Application to RAM without Paging by Chris

Chris
Wed Feb 08 11:42:01 CST 2006

I agree that obviously the code must be copied to RAM at some point. I
was hoping to be able to do that at power-on-reset time. It might be
that I find no significant performance difference between loading from
ROM with paging off or app loading from RAM, but I would like to find
out.

So ... if I have paging disabled and I put the binaries that I want to
be auto-copied into RAM in my "; @XIPREGION IF PACKAGE_OEMXIPKERNEL"
section of my platform.bib, will that force the loader to copy the
binaries into RAM?

Thanks,
-Chris


Re: Forcing Application to RAM without Paging by Steve

Steve
Wed Feb 08 12:57:02 CST 2006

If the module is in a BIB file as opposed to just stored in a FAT partition
on a NAND disk then the paging settings I mentioned for the profile in the
registry won't have any impact. You can set the "C" bit to compress the
module in the image and that disables XIP which for a NANDIMAGE will disable
the paging.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: Forcing Application to RAM without Paging by gerrit

gerrit
Wed Feb 08 13:05:11 CST 2006

I too am concerned about performance with XIP. Are there any
limitations to what can be marked as compressed? Does the kernel
itself already get copied to RAM?


Re: Forcing Application to RAM without Paging by Chris

Chris
Wed Feb 08 13:09:11 CST 2006

In answer to your question - I'm trying to optimize application
(EXE+DLLs) startup time - when user first requests app from Start 'til
the app is usable.

-Chris


Re: Forcing Application to RAM without Paging by Chris

Chris
Wed Feb 08 13:09:38 CST 2006

In answer to your question - I'm trying to optimize application
(EXE+DLLs) startup time - when user first requests app from Start 'til
the app is usable.

-Chris


Re: Forcing Application to RAM without Paging by Chris

Chris
Wed Feb 08 13:13:37 CST 2006

For devices that cannot XIP from ROM, yes, enough of the kernel to get
filesystem.exe started does get copied to RAM by the loader.

-Chris


Re: Forcing Application to RAM without Paging by Dean

Dean
Thu Feb 09 08:55:13 CST 2006

It's been a while, but I believe the answer to your question is yes. The
kernel and other critical components that are necessary to implement paging
can't be paged out. Other modules you choose to put in that region should
also not be paged out.


--
Dean Ramsier - eMVP
BSQUARE Corporation


"Chris Edgington" <cedgington@qualnetics.com> wrote in message
news:1139420521.050145.59160@g47g2000cwa.googlegroups.com...
>I agree that obviously the code must be copied to RAM at some point. I
> was hoping to be able to do that at power-on-reset time. It might be
> that I find no significant performance difference between loading from
> ROM with paging off or app loading from RAM, but I would like to find
> out.
>
> So ... if I have paging disabled and I put the binaries that I want to
> be auto-copied into RAM in my "; @XIPREGION IF PACKAGE_OEMXIPKERNEL"
> section of my platform.bib, will that force the loader to copy the
> binaries into RAM?
>
> Thanks,
> -Chris
>



Re: Forcing Application to RAM without Paging by Sue

Sue
Tue Feb 14 10:19:06 CST 2006

Hi Chris, we don't have anything in the OS that pre-loads binaries into RAM
for you. I think you'd have to write a file system filter driver or file
system driver to do the caching. With some work you could make something
that pages in at a low priority after boot so that pages are ready in RAM
when it's time to launch the application(s) you're interested in speeding
up. It is not a trivial project, but the hardest problem I see is managing
how much RAM your cache consumes, if you don't want to page all of it into
RAM at once.

Sue
sloh@microsoft.com (remove "online" from reply-to address)
http://blogs.msdn.com/ce_base/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________



Re: Forcing Application to RAM without Paging by Chris

Chris
Tue Feb 14 13:39:49 CST 2006

Thanks for the response, Sue. Back to my original question .... the
main reason for the post is the slowness in application startup and
demand-paging, primarily due to poor flash performance (optimizing that
is simply not an option right now - not for technical reasons). If we
decided that sacrificing some RAM was worth the reward, is it possible
to setup a separate block in ROM that would contain the EXEs and DLLs
of our choosing, and at boottime copy that block into a reserved chunk
of RAM and tell the kernel that this reserved chunk is another ROM
section - thereby enabling XIP of those components out of that RAM
section?

-Chris


Re: Forcing Application to RAM without Paging by Dean

Dean
Tue Feb 14 15:41:22 CST 2006

Sure. You just need to setup a multixip build, with the fast region located
in RAM. It would then be up to your loader to ensure that it got there.
--
Dean Ramsier - eMVP
BSQUARE Corporation


"Chris Edgington" <cedgington@qualnetics.com> wrote in message
news:1139945989.330970.153920@g44g2000cwa.googlegroups.com...
> Thanks for the response, Sue. Back to my original question .... the
> main reason for the post is the slowness in application startup and
> demand-paging, primarily due to poor flash performance (optimizing that
> is simply not an option right now - not for technical reasons). If we
> decided that sacrificing some RAM was worth the reward, is it possible
> to setup a separate block in ROM that would contain the EXEs and DLLs
> of our choosing, and at boottime copy that block into a reserved chunk
> of RAM and tell the kernel that this reserved chunk is another ROM
> section - thereby enabling XIP of those components out of that RAM
> section?
>
> -Chris
>