Patent ID: 8285918

Claim:
A method for operating a flash memory controller of a flash array, the flash array configured as a cache for a disk-based storage device, comprising: consolidating information concerning blocks of obsolete data stored in the flash array with information concerning blocks of data stored in the flash array that a cache management routine running on the controller has determined may be removed from the cache according to the determined data's likelihood of being accessed; ranking segments containing one or more of the blocks of obsolete data and the blocks of data that the cache management routine has determined may be removed from the cache; erasing the segments containing one or more of the blocks of obsolete data and the blocks of data that the cache management routine has determined may be removed from the cache to produce reclaimed segments of the flash array, each segment having multiple blocks of the flash array, wherein the segments are erased according to their respective rankings, wherein prior to erasing the segments containing one or more of the blocks of obsolete data and the blocks of data that the cache management routine has determined may be removed from the cache, writing valid data from the segments to other segments in the flash array, and wherein fewer than all of the segments containing one or more of the blocks of obsolete data and the blocks of data that the cache management routine has determined may be removed from the cache are erased.