Is there a high efficient memcpy api to copy from pmem to dram

37 views
Skip to first unread message

Chris Yu

unread,
Jul 29, 2019, 8:57:15 AM7/29/19
to pmem
Hi experts,
I found pmem_memcpy_persist in libpmem is much more efficient than linux memcpy when I copy data from dram to pmem. So I wonder if there is also an high efficient api to copy data from the pmem to dram.

Thanks,
Chris

Piotr Balcer

unread,
Jul 29, 2019, 1:48:20 PM7/29/19
to pmem
Hi Chris,
The main reason why we've created pmem_memcpy() was to avoid unnecessary flushes or fences when using non-temporal stores. Its performance might be better or worse than your OS memcpy() depending on various factors.
As you note, pmem_memcpy() is designed to be used for DRAM to PMEM transfers, but if you find it better for you workload, you can also use it as memcpy() replacement - it that cases, you should use PMEM_F_MEM_NOFLUSH flag.

Piotr
Reply all
Reply to author
Forward
0 new messages