
VxWorks
Hardware Considerations Guide, 6.0
24
Block Allocation and Data Clusters
As is required of a block device driver, TrueFFS maps flash memory into what
appears to be (from the users perspective) a contiguous array of storage blocks,
upon which a file system can read and write data. These blocks are numbered from
zero to one less than the total number of blocks. Currently, the only supported file
system is dosFs (for more information, see the appropriate VxWorks
programmer’s guide for your release).
Block Allocation Algorithm
To promote more efficient data retrieval, TrueFFS uses a flexible allocation strategy,
which clusters related data into a contiguous area in a single erase unit. These
clusters might be, for example, the blocks that comprise the sectors of a file.
TrueFFS follows a prioritized procedure for attempting to cluster related data in
the following order:
a. First, it tries to maintain a pool of physically consecutive free blocks that
are resident in the same erase unit.
b. If that fails, it then tries to assure that all the blocks in the pool reside in the
same erase unit.
c. If that fails, it finally tries to allocate a pool of blocks in the erase unit that
has the most space available.
Benefits of Clustering
Clustering related data in this manner has several benefits, listed and described
below.
■
Allows Faster Retrieval Times
For situations that require TrueFFS to access flash through a small memory
window, clustering related data minimizes the number of calls needed to map
physical blocks into the window. This allow faster retrieval times for files accessed
sequentially.
■
Minimizes Fragmentation.
Clustering related data cuts down on fragmentation because deleting a file tends
to free up complete blocks that can be easily reclaimed.
■
Speeds Garbage Collection
Minimizing fragmentation leads to faster garbage collection.
Comentarios a estos manuales