1PMEM2_DEEP_FLUSH(3) PMDK Programmer's Manual PMEM2_DEEP_FLUSH(3)
2
3
4
6 pmem2_deep_flush() - highly reliable persistent memory synchronization
7
9 #include <libpmem2.h>
10
11 int pmem2_deep_flush(struct pmem2_map *map, void *ptr, size_t size)
12
14 The pmem2_deep_flush() function forces any changes in the range [ptr,
15 ptr+len) from the map to be stored durably in the most reliable persis‐
16 tence domain available to software. In particular, on supported plat‐
17 forms, this enables the code not to rely on automatic cache or WPQ
18 (write pending queue) flush on power failure (ADR/eADR).
19
20 Since this operation is usually much more expensive than regular per‐
21 sist, it should be used sparingly. Typically, the application should
22 only ever use this function as a precaution against hardware failures,
23 e.g., in code that detects silent data corruption caused by unsafe
24 shutdown (see more in libpmem2_unsafe_shutdown(7)).
25
27 The pmem2_deep_flush() function returns 0 on success or an error code
28 on failure.
29
31 The pmem2_deep_flush() can fail with the following errors:
32
33 • PMEM2_E_DEEP_FLUSH_RANGE - the provided flush range is not a subset
34 of the map’s address space.
35
36 • PMEM2_E_DAX_REGION_NOT_FOUND - the underlying device region id cannot
37 be detected.
38
39 • -errno set by failing write(2), while trying to use the Device Dax
40 deep_flush interface.
41
42 • -errno set by failing open(2), while trying to open the Device Dax
43 deep_flush interface.
44
45 • -errno set by failing msync(2), while trying to perform a deep flush
46 on a regular DAX volume.
47
49 msync(2), open(2), pmem2_get_drain_fn(3), pmem2_get_persist_fn(3)
50 pmem2_map_new(3), write(2), libpmem2(7) and <http://pmem.io>
51
52
53
54PMDK - pmem2 API version 1.0 2020-10-28 PMEM2_DEEP_FLUSH(3)