FlashDisk Garbage Collection
Introduction
In FlashDisk when the file system write a sector through FlashDisk interface, the data is written to a new free sector position and the old sector with the same logical number is marked as invalid state. After a certain number of sector writes, the free sectors will become low, so a garbage collection is used to free the invalid flash memory space to allow further write operations.
Garbage Collection
Garbage collection is performed when the number of free sectors in the whole Flash is lower than a specified threshold value. It copies the valid sectors into new (free) sectors and erases the original invalid block.
The basic operations involved in Garbage Collection are the following:
1) The block with invalid sectors are selected for garbage collection. The selection follows an algorithm considered the performance and wear leveling.
2) The valid sectors are copied into a free sector in another block.
3) The block without valid sectors is erased and put to free block list.
Background Thread
There is a background thread in the FlashDisk which can be activated to optimize the overall performance. With this thread, the long erase times of Flash devices are completely transparent as the Garbage Collection is activated during the system's idle time. In this way, the FlashDisk erases sectors to free flash memory space automatically, and not only when the number of data sectors to be written exceeds the number of free sectors.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home