Re: [ANNOUNCE] kvm-46 release

Jun Koi
2007-10-11T01:02:48Z

On 10/10/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> Jun Koi wrote:
> > On 10/10/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> >
> >> Jun Koi wrote:
> >>
> >>> Hi,
> >>>
> >>> On 10/10/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> >>>
> >>>
> >>>> We've now switched to allocating guest memory in userspace rather than
> >>>> in the kernel. This is important if you have a mainframe, but also if
> >>>> you want to share memory between guests and implement nice features like
> >>>> swapping.
> >>>>
> >>>>
> >>> This is interesting! But how can we do that now? (share memory between guests)
> >>>
> >>>
> >>>
> >> It's not exposed by qemu, but you can now mmap() some file (or use SysV
> >> shared memory) and use that as guest memory.
> >>
> >>
> >
> > OK, lets say we have 2 guest VMs share a memory, like mmap() a tmpfs
> > file (which is actually in memory). Now one writes to the memory
> > (shared file). Can we guarantee that the memory immediately updated,
> > so other will see the change immediately? Or the data might be cached
> > for a while, befere being flushed to the shared memory?
> >
>
> Changes are visible immediately.
>

OK, that is about sharing memory file. How about a shared file in
which a file is a real physical file on the host?

As far as I remember, there is a caution about sharing a file using
mmap() between 2 processes, that is: if the first process modifies the
shared file, it might take a while for the changes to be flushed from
cache to the file. That means the other process doesnt see the change
immediately.

I guess this problem affects us in this case, when we use a real
(physical) file to share between 2 VMs, correct?

Thanks,
Jun