Q: Cramfs Vs. Ubifs

Ricard Wanderlof ricard.wanderlof at axis.com
Wed Jun 13 10:59:47 EDT 2012


On Wed, 13 Jun 2012, Ran Shalit wrote:

>>> If I start several executable from ubifs in some start point, Is it
>>> right to assume that all of them are running in RAM, and there is no
>>> access to flash after this start point of execution ?
>>
>> As someone else mentioned on the mtd list, Linux is demand paged which means
>> that the code is loaded into memory when needed. If there's a chunk of code
>> (Linux uses a page size of 4 kbytes so that's the granularity of the paging)
>> that is not used until after a while after the start of execution, it won't
>> be loaded until it is actually run.
>>
>> I don't know if there's a way to force it all into memory when execution
>> starts; there probably is.
>>
> In embedded system it is desired to execute only from RAM, therefore
> it seems that ubifs is not best choice here.

The demand paging concept simply means that the code is copied to RAM from 
the file system when needed, it is always executed from RAM. But yes, it 
can mean that the application has to wait for data to get copied during 
execution.

> It seems that in order to run completely from RAM I need to copy all
> the files in ubifs potion to RAM and then execute the application in
> RAM.

Even if you copy all files to a RAM-based file system, such as /tmp, they 
still need to be copied from the file system to directly accessible 
memory before execution. While it may be faster than performing the same 
operation from flash, the demand paging functionality is still in 
operation.

The only way to avoid it would be to force loading of all pages for a 
program at its start, I've never had the need so I don't know how though.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list