Patent attributes
Method and apparatus for managing data in a storage device, such as a solid-state drive (SSD). In some embodiments, write and read commands from a client device are placed into a command queue pending servicing to transfer data between the client device and a non-volatile memory (NVM). A write cache temporarily stores sets of writeback data pending transfer. A cache manager detects an overlap condition in which a subsequently received command at least partially overlaps a pending write command. In response, the cache manager enacts a change in caching policy that includes retention of the cached writeback data to aid in the servicing of the subsequently received command. The changes in caching policy can include an increase in the size of the write cache, delays in the writing of hot writeback data sets, the coalescing of different writeback data sets, cache hits using the cached writeback data, etc.