Data storage device and operating method thereof
A method for operating a data storage device includes determining an n th garbage collection throughput by multiplying a rate of a number of used pages of an open memory block to an amount of write data to be processed to a sum of the number of used empty memory blocks and an immediately previous garbage collection throughput average value; and performing a garbage collection operation based on the n th garbage collection throughput.
1. A method for performing garbage collection for a memory device by a controller controlling the memory device, the method comprising:
obtaining an average of an (n−2)th garbage collection throughput and an (n−1)th garbage collection throughput;
summing the average and a number of used empty memory blocks of the memory device, to obtain a first value;
obtaining a percentage of a number of used pages of an open memory block to an amount of write data;
determining by the controller, the nth garbage collection throughput by multiplying the first value and the percentage; and
performing, by the controller, a garbage collection operation based on the nth garbage collection throughput.
2. The method according to claim 1 , wherein the number of used empty memory blocks is a subtraction of the number of remaining empty memory blocks from the number of minimum empty memory blocks.
3. The method according to claim 1 , wherein the amount of write data is the maximum number of pages to be written to process write data.
4. The method according to claim 1 , wherein the open memory block includes at least a used page in which data is written and at least an empty page.
5. A data storage device comprising:
a memory device; and
a controller to control the memory device,
wherein the controller includes
a memory including a garbage collection module; and
a control unit executing the garbage collection module,
wherein the controller determines an nth garbage collection throughput by multiplying a rate of a number of used pages of an open memory block to an amount of write data to be processed to a sum of the number of used empty memory blocks and an immediately previous garbage collection throughput average value, and
wherein the controller performs a garbage collection operation based on the nth garbage collection throughput.
6. The data storage device according to claim 5 , wherein the number of used empty memory blocks is a subtraction of the number of remaining empty memory blocks from the number of minimum empty memory blocks.
7. The data storage device according to claim 5 , wherein the immediately previous garbage collection throughput average value is an average of an (n−2)th garbage collection throughput and an (n−1)th garbage collection throughput.
8. The data storage device according to claim 5 , wherein the amount of write data is obtained by ceiling a resultant value of dividing an amount of write data by a size of a page.
9. The data storage device according to claim 5 , wherein the open memory block includes at least a used page in which data is written and at least an empty page.
10. The data storage device according to claim 5 , wherein the memory device is a nonvolatile memory device.
11. The data storage device according to claim 10 , wherein the memory device is a flash memory device.