[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Execute-in-Place (XIP) from flash?



Hi Mikael,

I have been investigating this XIP option to see if it is a cheap and easy
way to cut down our memory usage. I was assuming the kernel would load the
entire binary and associated .so files to the RAM and execute them from
there. We have a system that currently needs a number of processes to run
concurrently, and any saving on RAM is welcome.

We do not have a swap partition, so I was thinking process code segment
would never be swapped out. A google search confirmed Linux will discard and
read back from disk such text and data segments as you have said, so there
is probably not much point in going XIP. The only gain would be the kernel
code segment could have been made to execute directly from flash, but this
is not required for us - 500k or so for the kernel is not an issue, and not
to be able to reprogram the flash when kernel is running is much worse than
saving this much ram.

Thanks for clarifying this.

Mahmut

> -----Original Message-----
> From: Mikael Starvik [mailto:mikael.starvik@xxxxxxx.com]
> Sent: Tuesday, 21 September 2004 3:45 PM
> To: Fettahlioglu, Mahmut; Jonas Holmberg
> Cc: dev-etrax
> Subject: RE: Execute-in-Place (XIP) from flash?
> 
> That is correct but I can't really see the point. Linux will page
> in pieces of the executable form flash to the page cache when a
> program is executed. If memory is low the program will be paged
> back to flash (except for dirty pages of cours).
> 
> So for me there is two questions:
> 
> 1. How are you going to tell the kernel that it should use XIP?
> 2. How will you benefit from it? One answer may be that you want
> to avoid pageing in and out for performance reasons.
> 
> Even if you manage to do true XIP you will still have all the
> writable segments of the applications in RAM.
> 
> Can you tell us more why you have so little RAM left but so
> much flash?
> 
> /Mikael
> 
> -----Original Message-----
> From: owner-dev-etrax@xxxxxxx.com">mailto:owner-dev-etrax@xxxxxxx.com] On
> Behalf Of Fettahlioglu, Mahmut
> Sent: Tuesday, September 21, 2004 3:56 AM
> To: Jonas Holmberg
> Cc: dev-etrax
> Subject: RE: Execute-in-Place (XIP) from flash?
> 
> 
> Thanks for the info Jonas.
> 
> It looks like the only chip available for this project will be the
> internal
> flash. It will be alright to use it entirely as read-only. As long as I
> guarantee XIP processes do not run during FTP flash reprogramming it
> should
> work fine then?
> 
> Thanks,
> Mahmut
> 
> > -----Original Message-----
> > From: Jonas Holmberg [mailto:jonas.holmberg@xxxxxxx.com]
> > Sent: Monday, 20 September 2004 5:38 PM
> > To: Fettahlioglu, Mahmut
> > Cc: ETRAX development list
> > Subject: Re: Execute-in-Place (XIP) from flash?
> >
> > On Mon, Sep 20, 2004 at 01:56:45PM +1000, Fettahlioglu, Mahmut wrote:
> > > Hi all,
> > >
> > > I was wondering if there is a way I can use execute-in-place with
> > MCM4+16
> > > chips to save runtime memory. The options seem to be:
> > >
> > > - Use the internal flash "/etc" partition. This would involve
> formatting
> > the
> > > JFFS2 partition with something else e.g. FAT as JFFS2 uses
> compression.
> > >
> > > - Use an external USB flash ad run the software from there
> > >
> > > Do you think there are some limitations that prevent one or both of
> > these
> > > options? And if it can be done, do I need to change something in the
> > kernel
> > > for this?
> > >
> > > Any feedback welcome. Thanks to all,
> >
> > To be able to write to flash and do XIP at the same time you need more
> > than one chip. You must never write or erase the chip you execute code
> > from.
> >
> > /Jonas