SOLID STATE DRIVE AND GARBAGE COLLECTION CONTROL METHOD THEREOF
A garbage collection control method for a solid state drive is provided. The garbage collection control method includes the following steps. Firstly, a total number of releasable spaces in a plurality of data-containing blocks of a flash memory is calculated and defined as A. A total number of spaces in a plurality of blank blocks of the flash memory is calculated and defined as B. If the ratio B/A is smaller than a first threshold value, a garbage collection is performed. During the garbage collection is performed, if the ratio B/A is larger than a second threshold value, the garbage collection is ended. The first threshold value is smaller than the second threshold value.
1 . A garbage collection control method for a solid state drive, the garbage collection control method comprising steps of:
calculating a total number of releasable spaces in a plurality of data-containing blocks of a flash memory, which is defined as A;
calculating a total number of spaces in a plurality of blank blocks of the flash memory, which is defined as B;
judging whether a ratio B/A is smaller than a first threshold value, wherein if the ratio B/A is smaller than the first threshold value, a garbage collection is performed; and
judging whether the ratio B/A is larger than a second threshold value during the garbage collection is performed, wherein if the ratio B/A is larger than the second threshold value, the garbage collection is ended,
wherein the first threshold value is smaller than the second threshold value.
2 . The garbage collection control method as claimed in claim 1 , wherein the total number of releasable spaces at least comprises a total number of invalid pages or blank pages included in the data-containing blocks.
3 . A garbage collection control method for a solid state drive, the garbage collection control method comprising steps of:
calculating a total number of releasable spaces in a plurality of data-containing blocks of a flash memory, which is defined as A;
calculating a total number of spaces in a plurality of blank blocks of the flash memory, which is defined as B;
judging whether a ratio B/(A+B) is smaller than a first threshold value, wherein if the ratio B/(A+B) is smaller than the first threshold value, a garbage collection is performed; and
judging whether the ratio B/(A+B) is larger than a second threshold value during the garbage collection is performed, wherein if the ratio B/(A+B) is larger than the second threshold value, the garbage collection is ended,
wherein the first threshold value is smaller than the second threshold value.
4 . The garbage collection control method as claimed in claim 3 , wherein the total number of releasable spaces at least comprises a total number of invalid pages or blank pages included in the data-containing blocks.
5 . A garbage collection control method for a solid state drive, the garbage collection control method comprising steps of:
calculating a total number of releasable spaces in a plurality of data-containing blocks of a flash memory, which is defined as A;
calculating a total number of spaces in a plurality of blank blocks of the flash memory, which is defined as B;
determining whether a garbage collection is performed or not according to a relationship between A and B.
6 . A solid state drive in communication with a host, the solid state drive comprising:
a flash memory with a plurality of blocks, wherein each of the blocks comprises a plurality of pages; and
a controlling unit in communication with the flash memory for calculating a total number of releasable spaces in a plurality of data-containing blocks of a flash memory, which is defined as A and calculating a total number of spaces in a plurality of blank blocks of the flash memory, which is defined as B, wherein a timing of performing a garbage collection on the flash memory by the controlling unit is determined according to a relationship between A and B.
7 . The solid state drive as claimed in claim 6 , wherein if a ratio B/A is smaller than a first threshold value, the garbage collection is performed, wherein during the garbage collection is performed, if the ratio B/A is larger than a second threshold value, the garbage collection is ended, wherein the first threshold value is smaller than the second threshold value.
8 . The solid state drive as claimed in claim 6 , wherein if a ratio B/(A+B) is smaller than a first threshold value, the garbage collection is performed, wherein during the garbage collection is performed, if the ratio B/(A+B) is larger than a second threshold value, the garbage collection is ended, wherein the first threshold value is smaller than the second threshold value.
9 . The solid state drive as claimed in claim 6 , wherein the total number of releasable spaces at least comprises a total number of invalid pages or blank pages included in the data-containing blocks.