Hi,
Thanx for your information. Yes, pcache currently only allow pmem
to be cache_dev.
(1) I would suggest you to do some testing on pmem firstly.
You can use memmap kernel option to emulate pmem device:
https://docs.pmem.io/persistent-memory/getting-started-guide/creating-development-environments/linux-environments/linux-memmap
Then you can try dm-pcache, to see is that what you want.
Of course, if you want to do some performance compare, remember to use
pmem for bcache too, /dev/pmem0 is also working to be cache device for
bcache.
(2) I would suggest you add more io pattern in you testing script:
iodepth=1, numjobs=1 for latency when workload is not heavy but it want
ack from device ASAP. That's important in lots of latency sensitive
application.
iodepth=1, numjobs=32 or 16. multiple application are running on a large
disk.
(3) LRU is already on the TODO list
in Documentation/admin-guide/device-mapper/dm-pcache.rst
(4) NVME backend is not impossible, but my current high-priority task is
to stabilize dm-pcache and ensure it runs well in the pmem scenario.
Then, consideration may be given to the nvme backend.
Thanx
Dongsheng
在 8/21/2025 3:15 AM, Giovanni Francesco 写道:
Hello,
I would like to ask for consideration of adding NVMe disk support to the
caching layer in `dm-pcache`. At present, `cache_dev` only supports `pmem`.
From my perspective, extending `pcache` to support NVMe devices (along with an
LRU-based eviction policy) could make it a strong alternative to `bcache` in
certain use cases. For example, `pcache` appears to work without requiring the
backing storage devices to be reformatted, which I see as a practical advantage.
For my home server workloads, I experimented with `lvmcache`, but I found both
writeback and read performance unsatisfactory compared to what I was hoping
for. My test notes and benchmarks are available here for anyone interested:
https://github.com/TheLinuxGuy/ugreen-nas/tree/main/experiments-bench
Would adding NVMe support (and potentially configurable caching policies like
LRU) be of interest to the project? I am happy to assist with testing or
provide more detailed feedback from my benchmarks if that would be useful.
Thanks for your time and consideration.
Giovanni