From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v5 4/5] Inter-VM shared memory PCI device Date: Tue, 11 May 2010 17:53:04 +0300 Message-ID: <4BE96F50.1040506@redhat.com> References: <1271872408-22842-1-git-send-email-cam@cs.ualberta.ca> <4BE82623.4000905@redhat.com> <4BE82877.1040408@codemonkey.ws> <4BE83B69.4040904@redhat.com> <4BE84172.9080305@codemonkey.ws> <4BE847CB.7050503@codemonkey.ws> <4BE90E6D.7070007@redhat.com> <4BE9572B.3010104@codemonkey.ws> <4BE963C9.9090308@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Cam Macdonell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18793 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753646Ab0EKOxP (ORCPT ); Tue, 11 May 2010 10:53:15 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 05/11/2010 05:17 PM, Cam Macdonell wrote: > >> The master is the shared memory area. It's a completely separate entity >> that is represented by the backing file (or shared memory server handing out >> the fd to mmap). It can exists independently of any guest. >> > I think the master/peer idea would be necessary if we were sharing > guest memory (sharing guest A's memory with guest B). Then if the > master (guest A) dies, perhaps something needs to happen to preserve > the memory contents. Definitely. But we aren't... > But since we're sharing host memory, the > applications in the guests can race to determine the master by > grabbing a lock at offset 0 or by using lowest VM ID. > > Looking at it another way, it is the applications using shared memory > that may or may not need a master, the Qemu processes don't need the > concept of a master since the memory belongs to the host. > Exactly. Furthermore, even in a master/slave relationship, there will be different masters for different sub-areas, it would be a pity to expose all this in the hardware abstraction. This way we have an external device, and PCI HBAs which connect to it - just like a multi-tailed SCSI disk. -- error compiling committee.c: too many arguments to function