chenzhangyu / Clevel-Hashing

Lock-free Concurrent Level Hashing for Persistent Memory (USENIX ATC 2020)
Other
50 stars 13 forks source link

question of PM #2

Closed DragonmingLi closed 2 years ago

DragonmingLi commented 3 years ago

How could I know if it it a program running on PM, because I can run examples without PM too. Thanks for answer

chenzhangyu commented 3 years ago

How could I know if it it a program running on PM, because I can run examples without PM too. Thanks for answer

In fact, our examples can run on both PM and DRAM platform, which depends on the pool path. If the pool path is on PM, PMDK will leverage flush and fence instructions to persist writes (e.g., pop.persist()). If the pool path is on disk and PMEM_IS_PMEM_FORCE is 0, PMDK will invoke msync() to persist modifications, which can be very slow. Setting PMEM_IS_PMEM_FORCE to 1 can enforce the use of flush instructions instead of msync() and avoid the performance degradation. However, clevel hashing with PMEM_IS_PMEM_FORCE=1 is not crash consistent.

More details about the typical usage of PMEM_IS_PMEM_FORCE are available in the https://pmem.io/pmdk/manpages/linux/master/libpmem/libpmem.7.html.