On Fri, 05 Dec 2008 Cam Macdonell wrote :
> Min Xu (Hsu) wrote:
> > On Fri, 05 Dec 2008 Cam Macdonell wrote :
> >> I can certainly see how a datagram model has some advantages.  But, I'm 
> >> trying to do caching and for this purpose using shared memory requires 
> >> less concurrent programming (threads, etc) and it reduces unnecessary 
> >> copying of the data.  I'm looking at VMs in the context of distributed 
> >> high-performance computing.  Our VMs are disposable sandboxes in this 
> >> use, so suspension and replay are not features we need.
> > 
> > I see. This use case does make sense to me. Thanks a lot for sharing it.
> > I wonder does the shared memory punch a hole in your sandboxes in that a
> > incorrect program in one VM can change the shared memory in a way to
> > crash other VMs? Perhaps the shared memory is readonly from the VMs?
> > 
> 
> The idea, whether it will work or not, is that the cache will only be 
> used as an optimization.  The VMs will always have the regular file 
> system API to access the files, but if the file is in the cache it will 
> use that.  As for inconsistent data causing problems, it will require 
> checks that prevent that from happening and synchronization to prevent 
> multiple writers.
> 
> > If you are caching a readonly FS, maybe there is a better way?
> 
> Not just readonly, but mostly reading.  I'm always interested in hearing 
> of better ways!

Hi Cam,

I am certainly no expert on the problem you are dealing. But personally,
I would imagine having shared memory between VMs may cause the sandboxing
become ineffective. Deadlocks, rare conditions, etc. may happen if
synchronization are done incorrectly. I am not saying datagram does not
have these synchronization problems. The problem of distributed file
system is inherently hard.

For caching, I feel a better way is to let the virtual machine monitor
deal with it transparently. On our product, we have transparent memory
sharing between VMs. It means if two VMs are using two "virtual
physical" memory pages that have identical contents, the monitor will
make the two VMs use the same physical memory page. This is done without
breaking isolation between VMs. So for caching, perhaps you can make sure
each VM cache same data in same page offset so the monitor can back them
using the same host physical memory? I don't know if we provide an API
for the VM to "hint" the virtual machine monitor what pages maybe
shared. But hinting is a possibility too.

thanks,
min


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to