.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-26" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020, Intel Corporation .SH NAME .PP \f[B]pmem2_deep_flush\f[R]() - highly reliable persistent memory synchronization .SH SYNOPSIS .IP .nf \f[C] #include int pmem2_deep_flush(struct pmem2_map *map, void *ptr, size_t size) \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_deep_flush\f[R]() function forces any changes in the range [\f[I]ptr\f[R], \f[I]ptr\f[R]+\f[I]len\f[R]) from the \f[I]map\f[R] to be stored durably in the most reliable persistence domain available to software. In particular, on supported platforms, this enables the code not to rely on automatic cache or WPQ (write pending queue) flush on power failure (ADR/eADR). .PP Since this operation is usually much more expensive than regular persist, it should be used sparingly. Typically, the application should only ever use this function as a precaution against hardware failures, e.g., in code that detects silent data corruption caused by unsafe shutdown (see more in \f[B]libpmem2_unsafe_shutdown\f[R](7)). .SH RETURN VALUE .PP The \f[B]pmem2_deep_flush\f[R]() function returns 0 on success or an error code on failure. .SH ERRORS .PP The \f[B]pmem2_deep_flush\f[R]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_DEEP_FLUSH_RANGE\f[R] - the provided flush range is not a subset of the map\[cq]s address space. .IP \[bu] 2 \f[B]PMEM2_E_DAX_REGION_NOT_FOUND\f[R] - the underlying device region id cannot be detected. .IP \[bu] 2 -\f[B]errno\f[R] set by failing \f[B]msync\f[R](2), while trying to perform a deep flush on a regular DAX volume. .SH SEE ALSO .PP \f[B]msync\f[R](2), \f[B]pmem2_get_drain_fn\f[R](3), \f[B]pmem2_get_persist_fn\f[R](3) \f[B]pmem2_map\f[R](3), \f[B]libpmem2\f[R](7) and \f[B]\f[R]