On Tue, Apr 30, 2019 at 05:46:36PM -0300, Eduardo Habkost wrote: >Hi, > >On Fri, Apr 26, 2019 at 08:36:51AM +0800, Wei Yang wrote: >> From: Zhang Yi <yi.z.zh...@linux.intel.com> >> >> 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.zh...@intel.com> >> Signed-off-by: Zhang Yi <yi.z.zh...@linux.intel.com> >> [ehabkost: Rebased patch to latest code on master] >> Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> >> Signed-off-by: Wei Yang <richardw.y...@linux.intel.com> >> Tested-by: Wei Yang <richardw.y...@linux.intel.com> >> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> >> >> --- >> v15: fix compile issue on pre-linux4.15 >> v14: rebase on top of current upstream > >Note that v14 was already merged, so the build fix would need to >be submitted separately. However: >
Sure, I would spin a separate patch. >[...] >> +#ifdef CONFIG_LINUX >> +#include <linux/mman.h> >> +#endif /* CONFIG_LINUX */ >> + >> +#ifndef MAP_SYNC >> +#define MAP_SYNC 0 >> +#endif >> +#ifndef MAP_SHARED_VALIDATE >> +#define MAP_SHARED_VALIDATE 0 >> +#endif > >Why would we need this, if we added copies of mman.h to >linux-headers? This is reported by Stefan. https://www.mail-archive.com/qemu-devel@nongnu.org/msg612168.html > >-- >Eduardo -- Wei Yang Help you, Help me