how we can flush big buffers bigger than 4Kbytes ?

25 views
Skip to first unread message

David Moses

unread,
Dec 28, 2018, 2:29:37 PM12/28/18
to pmem
Doe's  pmem_memove_persist can be a good practice?
If  the answer is yes, in memmove_nodrain_movnt there is a check *pmemsest == * src ,what is  the reason for it? 
If the answer is no,  what are the other alternatives? 
Thx 
David 

Andy Rudoff

unread,
Dec 30, 2018, 1:14:27 PM12/30/18
to pmem
Hi David,

Your subject line seems to ask a different question than the body of your message, so I'll start with the subject line question.  Use pmem_persist() to flush a range of persistent memory.  That call is optimized for any size range and we will continue to optimize it in the future if faster ways of flushing become available.  For example, it may be true at some point in the future that calling into the kernel via msync() will be faster for very large ranges.  it isn't true right now, but if that changes, pmem_persist() will detect those cases and turn over the flushing to msync() when appropriate.

The body of your message is asking about pmem_memmove_persist() and for copying large ranges of data to pmem and ensuring it is flushed to persistence, this is the best choice available.  There are some use cases where the use of non-temporal stores is not the optimal way of moving data, and for those cases we have pmem_memmove() that take flags as described in the man page: http://pmem.io/pmdk/manpages/linux/master/libpmem/pmem_memmove_persist.3  Benchmarking is really the only sure way to determine which flags work best for your use case, but in most cases just calling pmem_memmove_persist() is what you want.  Remember that the libpmem APIs are not transactional, so it is up to you to determine how to recover from a crash in the middle of a copy (for transactional updates to pmem, use a library like libpmemobj).

I'm not understanding your question where you say "*pmemsest == * src".  Can you rephrase that question?

Thanks,

-andy
Reply all
Reply to author
Forward
0 new messages