qemu/util
Zhang Yi 119906afa5 util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()
When a file supporting DAX is used as vNVDIMM backend, mmap it with
MAP_SYNC flag in addition which can ensure file system metadata
synced in each guest writes to the backend file, without other QEMU
actions (e.g., periodic fsync() by QEMU).

Current, We have below different possible use cases:

1. pmem=on is set, shared=on is set, MAP_SYNC supported:
   a: backend is a dax supporting file.
    - MAP_SYNC will active.
   b: backend is not a dax supporting file.
    - mmap will trigger a warning. then MAP_SYNC flag will be ignored

2. The rest of cases:
   - we will never pass the MAP_SYNC to mmap2

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Signed-off-by: Zhang Yi <yi.z.zhang@linux.intel.com>
[ehabkost: Rebased patch to latest code on master]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Tested-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190422004849.26463-2-richardw.yang@linux.intel.com>
[ehabkost: squashed documentation patch]
Message-Id: <20190422004849.26463-3-richardw.yang@linux.intel.com>
[ehabkost: documentation fixup]
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-04-25 14:17:36 -03:00
..
Makefile.objs
aio-posix.c
aio-wait.c
aio-win32.c
aiocb.c
async.c
atomic64.c
base64.c
bitmap.c
bitops.c
buffer.c
bufferiszero.c
cacheinfo.c
compatfd.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
crc32c.c
cutils.c
drm.c
envlist.c
error.c
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
filemonitor-inotify.c
filemonitor-stub.c
getauxval.c
hbitmap.c
hexdump.c
host-utils.c
id.c
iohandler.c
iov.c
iova-tree.c
keyval.c
lockcnt.c
log.c
main-loop.c
memfd.c
mmap-alloc.c util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap() 2019-04-25 14:17:36 -03:00
module.c
notify.c
osdep.c
oslib-posix.c
oslib-win32.c
pagesize.c
path.c
qdist.c
qemu-config.c
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-error.c
qemu-openpty.c
qemu-option.c
qemu-print.c
qemu-progress.c
qemu-sockets.c
qemu-thread-common.h
qemu-thread-posix.c
qemu-thread-win32.c
qemu-timer-common.c
qemu-timer.c
qht.c
qsp.c
range.c
rcu.c
readline.c
stats64.c
sys_membarrier.c
systemd.c
thread-pool.c
throttle.c
timed-average.c
trace-events
unicode.c
uri.c
uuid.c
vfio-helpers.c