summary refs log tree commit diff
path: root/p9
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-02-07 11:00:55 -0800
committerCommit Bot <commit-bot@chromium.org>2020-04-08 06:09:25 +0000
commite1980a9c360b04705a16434bdaf1a56161dafb56 (patch)
tree95944d7bfa87505050c2716fd764ffd1699d737e /p9
parentf3081b120e0934539f6f3f2c60c9ff26c801c0ea (diff)
downloadcrosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar.gz
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar.bz2
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar.lz
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar.xz
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.tar.zst
crosvm-e1980a9c360b04705a16434bdaf1a56161dafb56.zip
devices: pmem: implement flush using msync()
Previously, writable pmem devices implemented the flush command using
fsync(); however, this does not guarantee synchronization of memory
mappings via mmap() to the file on disk.  What we actually need is
msync() on the pmem file mapping, but we don't have access to that
mapping in the pmem child process, and it isn't trivial to pass it along
since it is owned by the Vm object once it has been added as a
mmap_arena.

In order to call msync() on the mapping, add a new VmControl socket so
that the pmem device can request that the main process issues an msync()
on the MemoryMappingArena identified by its slot number.

BUG=chromium:1007535
TEST=mount filesystem on /dev/pmem0 and sync; verify msync in strace

Change-Id: Id0484757c422cf81d454fd54012a12dbcc1baaf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2044365
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'p9')
0 files changed, 0 insertions, 0 deletions