public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Memory sharing among guest OSs
@ 2007-11-28 10:52 Haifeng He
       [not found] ` <ab08258e0711280252n5e72267q7c18c3ea254916b2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Haifeng He @ 2007-11-28 10:52 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

I am pretty new to KVM. I have a question which is if it
is possible (or easy) to share memory(such identical pages)
among guest OSs in KVM?

Thanks
Haifeng

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory sharing among guest OSs
       [not found] ` <ab08258e0711280252n5e72267q7c18c3ea254916b2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-11-28 15:39   ` Avi Kivity
       [not found]     ` <474D8B97.6090100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-11-28 15:39 UTC (permalink / raw)
  To: Haifeng He; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Haifeng He wrote:
> Hi,
>
> I am pretty new to KVM. I have a question which is if it
> is possible (or easy) to share memory(such identical pages)
> among guest OSs in KVM?
>
>   

In KVM, guest memory is normal userspace memory.  So you can use any of 
the standard Linux shared memory mechanisms to share memory among guests.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory sharing among guest OSs
       [not found]     ` <474D8B97.6090100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-11-28 16:12       ` Javier Guerra
       [not found]         ` <90eb1dc70711280812r7c55d15ehacf2645c0a42ae81-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Guerra @ 2007-11-28 16:12 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 11/28/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> Haifeng He wrote:
> > I am pretty new to KVM. I have a question which is if it
> > is possible (or easy) to share memory(such identical pages)
> > among guest OSs in KVM?
>
> In KVM, guest memory is normal userspace memory.  So you can use any of
> the standard Linux shared memory mechanisms to share memory among guests.

so the question would be if QEMU has any mechanism to setup that
shared memory, right?

if so, how would that look to the guest OS?

i guess it would be nice if the "-net user" facility could emulate an
RDMA-capable card using real shared memory, but AFAIK, RDMA doesn't
look exactly like remote shared memory.

-- 
Javier

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory sharing among guest OSs
       [not found]         ` <90eb1dc70711280812r7c55d15ehacf2645c0a42ae81-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-11-30  7:12           ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2007-11-30  7:12 UTC (permalink / raw)
  To: Javier Guerra; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Javier Guerra wrote:
> On 11/28/07, Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>   
>> Haifeng He wrote:
>>     
>>> I am pretty new to KVM. I have a question which is if it
>>> is possible (or easy) to share memory(such identical pages)
>>> among guest OSs in KVM?
>>>       
>> In KVM, guest memory is normal userspace memory.  So you can use any of
>> the standard Linux shared memory mechanisms to share memory among guests.
>>     
>
> so the question would be if QEMU has any mechanism to setup that
> shared memory, right?
>
>   

Right now, it doesn't.

> if so, how would that look to the guest OS?
>
>   

If done naively, part of guest memory would be shared among other
guests.  Unless the guest was modified to handle it, it would crash
fairly quickly.

One way to do it right is to define a "memory extension pci card" (say,
'qemu -memory-card /dev/shm/shared_mem -hda ...' to insert it into the
guest), and a guest PCI driver for it would map the memory into the
guest address space.  This should be fairly easy to do.

> i guess it would be nice if the "-net user" facility could emulate an
> RDMA-capable card using real shared memory, but AFAIK, RDMA doesn't
> look exactly like remote shared memory.
>
>   

No, RDMA is not transparent, while shared memory is.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-11-30  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-28 10:52 Memory sharing among guest OSs Haifeng He
     [not found] ` <ab08258e0711280252n5e72267q7c18c3ea254916b2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-11-28 15:39   ` Avi Kivity
     [not found]     ` <474D8B97.6090100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-28 16:12       ` Javier Guerra
     [not found]         ` <90eb1dc70711280812r7c55d15ehacf2645c0a42ae81-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-11-30  7:12           ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox