From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-5462-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis.ws5.connectedcommunity.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 50276985C75 for ; Tue, 19 Feb 2019 16:02:29 +0000 (UTC) MIME-Version: 1.0 References: <20190204054053.GE29758@stefanha-x1.localdomain> <20190204101316.4e3e6rj32suwdmur@sirius.home.kraxel.org> <20190211092943-mutt-send-email-mst@kernel.org> <20190219071222.jjebzcbh55kwlspn@sirius.home.kraxel.org> In-Reply-To: <20190219071222.jjebzcbh55kwlspn@sirius.home.kraxel.org> From: Frank Yang Date: Tue, 19 Feb 2019 08:02:16 -0800 Message-ID: Content-Type: multipart/alternative; boundary="0000000000002f2c6d0582415e8c" Subject: Re: [virtio-dev] Memory sharing device To: Gerd Hoffmann Cc: "Michael S. Tsirkin" , Roman Kiryanov , Stefan Hajnoczi , virtio-dev@lists.oasis-open.org, "Dr. David Alan Gilbert" List-ID: --0000000000002f2c6d0582415e8c Content-Type: text/plain; charset="UTF-8" On Mon, Feb 18, 2019 at 11:12 PM Gerd Hoffmann wrote: > Hi, > > > slots by doing so. So for Vulkan, we rely on having one large host > visible > > region on the host that is a single region of host shared memory. That, > is > > then sub-allocated for the guest. So there is no Vulkan host pointer that > > Yes, sub-allocating will be needed for reasonable performance. > > > In general though, this means that the ideal usage of host pointers would > > be to set a few regions up front for certain purposes, then share that > out > > amongst other device contexts. This also facilitates sharing the memory > > between guest processes, which is useful for implementing things like > > compositors. > > Guest processes in the same VM or in different VMs? > The guest processes are in the same VM. Are you also considering the usage in different VMs? In that case, if we had to address it, we would rely on there being an existing method on the host to map shared regions across processes, similar to gralloc, and use the fact that for each VM, they have a host pointer somehow, and expose the relevant host pointer to the guest. > This also features heavily for our "virtio userspace" thing. > > Since this is a common pattern, should this sharing concept be > standardized > > somehow? I.e., should there be a standard way to send Shmid/offset/size > to > > other devices, or have that be a standard struct in the hypervisor? > > Same question: other devices of the same VM? > Yes, also, other devices of the same VM. For different VMs, does the same scheme to send shmid/offset/size to other VMs work? Shmid's could be different and alias a common shared memory on the host, or additional metadata could be passed at some other level about which memory is "actually" shared. > cheers, > Gerd > > --0000000000002f2c6d0582415e8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Feb 18, 2019 at 11:12 PM Gerd= Hoffmann <kraxel@redhat.com>= ; wrote:
=C2=A0 = Hi,

> slots by doing so. So for Vulkan, we rely on having one large host vis= ible
> region on the host that is a single region of host shared memory. That= , is
> then sub-allocated for the guest. So there is no Vulkan host pointer t= hat

Yes, sub-allocating will be needed for reasonable performance.

> In general though, this means that the ideal usage of host pointers wo= uld
> be to set a few regions up front for certain purposes, then share that= out
> amongst other device contexts. This also facilitates sharing the memor= y
> between guest processes, which is useful for implementing things like<= br> > compositors.

Guest processes in the same VM or in different VMs?
=C2=A0
=C2=A0
The guest processes are in the sam= e VM.
Are you also considering the usage in different VMs?
<= div>In that case, if we had to address it, we would rely on there being
an existing method on the host to map shared regions across processe= s,
similar to gralloc,
and use the fact that for each V= M, they have a host pointer somehow,
and expose the relevant host= pointer to the guest.

> This also features heavily for our "virtio userspace" thing.=
> Since this is a common pattern, should this sharing concept be standar= dized
> somehow? I.e., should there be a standard way to send Shmid/offset/siz= e to
> other devices, or have that be a standard struct in the hypervisor?
Same question: other devices of the same VM?

Yes, also, other devices of the same VM.
For different VMs,= does the same scheme to send shmid/offset/size to other VMs work?
Shmid's could be different and alias a common shared memory on the ho= st,
or additional metadata could be passed at some other level
about which memory is "actually" shared.


cheers,
=C2=A0 Gerd

--0000000000002f2c6d0582415e8c--