On Tue, Dec 18, 2018 at 04:16:44PM +0800, Zhang Yi wrote: > Linux 4.15 introduces a new mmap flag MAP_SYNC, which can be used to > guarantee the write persistence to mmap'ed files supporting DAX (e.g., > files on ext4/xfs file system mounted with '-o dax'). > > A description of MAP_SYNC and MAP_SHARED_VALIDATE can be found at > https://patchwork.kernel.org/patch/10028151/ > > In order to make sure that the file metadata is in sync after a fault > while we are writing a shared DAX supporting backend files, this > patch-set enables QEMU to use MAP_SYNC flag for memory-backend-dax-file. > > As the DAX vs DMA truncated issue was solved, we refined the code and > send out this feature for the v5 version. > > A new auto on/off option 'sync' is added to memory-backend-file: > - on: try to pass MAP_SYNC to mmap(2); if MAP_SYNC is not supported or > 'share=off' or 'pmem=off', QEMU will abort > - off: never pass MAP_SYNC to mmap(2) > - auto (default): if MAP_SYNC is supported and 'share=on' 'pmem=on', work as > if > 'sync=on'; otherwise, work as if 'sync=off'
I took a quick look and didn't see human-readable errors when pmem=off. Is it possible to report it instead of aborting? Thanks, Stefan
signature.asc
Description: PGP signature