Download Comparative Study on Real Time Enhanced Linux

Transcript
370
some into a swap-partition can improve performance, but this is the case due
to the different strategies that Linux uses to optimize memory usage - swapping
to a slow media would hurt performance greatly - swapping to a fast media
will improve swap performance and at the same time the Linux kernel will
modify its optimization strategy to use the reduced RAM as good as possible.
The implementation of such RAM-swap-DISKS can be done with current MTD
drivers using slram on top of mtdblock. Slram provide access to the memory
area reserved (by passing a mem= argument to the kernel limiting the kernels
memory to less than physically available), mtdblock provide the block devices
interface so that this memory area can then be formated as swap partition on
system boot.
Flash technologies
In this section a brief introduction to flash-technology is given , this is necessary to understand the difference in system setups between standard desk-top
systems and flash based systems. This has clear indications for the selection of
filesystems and boot/operational concepts. As this knowledge is probably not
that wide spread, this slightly off-topic section is inserted.
Flash
As embedded system designers don’t like rotating media, solid state devices
have been becoming very common - they provide high storage density at low
power consumption and relatively low expenses. The two major types of Flash
are the directly accessible NOR flash, and the newer, cheaper NAND flash,
addressable only through a single 8-bit bus (for both data and addresses) and
additional control lines.
Unlike RAM chips flash chips are not able to simply set bits to 0 or 1,
each bit in an erased flash is set to a logical one, write operations set it to
logic 0.Due to this operating a flash device requires a separate process to take
care of this erasing / s̈etting to logic 1¨, this process is done by the cleaner or
garbage-collection.
Flash chips are arranged in blocks 128KB (NOR) and 8KB (NAND), this is
the reason for the difference in reserved area in jffs2 for the garbage-collection,
which is currently five such erase blocks - work is ongoing to reduce this in future
versions of jffs2. Resetting bits from zero to one cannot be done individually, but
only by resetting (or “erasing”) a complete block. The lifetime of a flash chip is
measured in such erase cycles, with the typical lifetime being about 100,000 to
1,000,000 erase operations. To ensure that no one erase block reaches this limit
before the rest of the chip, most users of flash chips attempt to ensure that erase
cycles are evenly distributed around the flash; a process known as wear leveling.
As this wear leveling requires to move data around on the device ,which is taken
care by the garbage-collection thread, and access to flash devices is relatively
slow, overall throughput of such devices is low compared to hard-disks. Typical