Patent ID: 9141533
Filing Date: 2015-09-22
Classification: G06F

Abstract:
1. A data storage device, comprising: a Flash memory; and a controller, controlling the Flash memory in accordance with firmware, wherein when the firmware is available for at least a predetermined time period without being requested by a host, the controller, driven according to the firmware, performs a garbage-collection operation on the Flash memory without a request from the host, wherein: the Flash memory provides a plurality of blocks for data storage, each block including a plurality of pages; when the firmware is available for at least the predetermined time period without being requested by the host, the controller samples a plurality of low-efficiency blocks from the plurality of blocks in the Flash memory, the plurality of low-efficiency blocks having a smaller amount of valid pages in comparison to the remaining blocks in the Flash memory; the controller classifies the Flash memory in accordance with the low-efficiency blocks and, when classifying the Flash memory as dirty, the controller moves valid data contained in the low-efficiency blocks to other blocks; the controller classifies the Flash memory as clean when average number of valid pages in the low-efficiency blocks is higher than a threshold number, otherwise, the controller classifies the Flash memory as dirty; and when the Flash memory is classified as clean and no command requiring firmware operations is transmitted from the host, or when valid data are all removed from the low-efficiency blocks and no command requiring firmware operations is transmitted from the host, the controller increases the threshold number and observes a new set of low-efficiency blocks, reclassifies the Flash memory in accordance with the new set of low-efficiency blocks and the threshold number that has been increased and, when the Flash memory is reclassified as dirty, the controller moves valid data contained in the new set of low-efficiency blocks to other blocks.