Patent ID: 8549230
Filing Date: 2013-10-01
Classification: G06F

Abstract:
1. A computer-implemented method for flushing a portion of a disk cache, the method comprising: maintaining a valid bitmap and a dirty bitmap for a cache line, the valid bitmap comprising a plurality of bits corresponding to sectors of the cache line wherein each bit is utilized to indicate whether the corresponding sector of the cache line is valid in the disk cache and can be used to satisfy read requests, and the dirty bitmap comprising one or more bits that each correspond to a sector of the cache line and that each indicate whether the corresponding sector includes data that needs to be flushed to a disk; locking the dirty bitmap using a spinlock; copying the contents of the dirty bitmap to a shadow bitmap, the shadow bitmap comprising the one or more bits that each correspond to a sector of the cache line and that each indicate whether the corresponding sector includes data that needs to be flushed to a disk; determining whether copying has been completed; in response to determining that copying has been completed, clearing the contents of the dirty bitmap; releasing the spinlock to allow access to the dirty bitmap; identifying, based on the contents of the shadow bitmap, the sectors of the cache line that need to be flushed; flushing the identified sectors to the disk, wherein the cache line is unlocked while the identified sectors are being flushed; determining whether flushing has been completed; and in response to determining that flushing has been completed, clearing the contents of the shadow bitmap, wherein the contents of the dirty bitmap are cleared before flushing has been completed.