摘要 |
A method and apparatus for flushing a write cache includes receiving a read or a write storage request, determining whether the storage request comprises a full or partial hit with data stored in a write cache one or more lines, some of which may be dirty. If the hit is partial and the one or more lines of the data are dirty, flushing the dirty data. If the hit is full or partial and any of the write cache lines are not dirty, and the storage request is a write request, flushing the dirty write cache lines, invalidating the non dirty write cache line, writing the storage request data into the write cache as a new write cache line and marking the new write cache line dirty. If the hit is full, all write cache lines are marked dirty, and the storage request is a write request, overlaying the cache write line with the storage request data and marking the write cache line as dirty.
|