[linux-lvm] cache on SSD makes system unresponsive

Chris Friesen chris.friesen at windriver.com
Tue Oct 24 23:10:27 UTC 2017

On 10/24/2017 04:01 PM, matthew patton wrote:

> How in the hell is the LVM cache being used at all? It has no business
> caching ANYTHING on streaming reads. Hmm, it turns out dm-cache/lvmcache
> really is retarded. It copies data to cache on first read and furthermore
> doesn't appear to detect streaming reads which have no value for caching
> purposes.

Technically it's not entirely true to say that streaming reads have no value for 
caching purposes.  It's conceivable to have a workload where the same file gets 
read over and over, in which case it might be useful to have it cached on an SSD.

As I understand it dm-cache is using smq, which essentially uses an LRU 
algorithm.  So yes, it'll read the streaming data into the cache, but the 
read-once/written-never data should also be the most likely to be evicted from 
the cache.

For what it's worth, the Linux kernel also copies data to the page cache on 
reads, which is why they introduced posix_fadvise(POSIX_FADV_DONTNEED) to allow 
the application to indicate that it's done with the data and it can be dropped 
from the page cache.


More information about the linux-lvm mailing list