From: "Michael S. Tsirkin" <mst@redhat.com>
To: Albert Esteve <aesteve@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@gmail.com,
cohuck@redhat.com, Fam Zheng <fam@euphon.net>,
kraxel@redhat.com
Subject: Re: [PATCH v4 3/4] vhost-user: add shared_object msg
Date: Thu, 27 Jul 2023 10:56:58 -0400 [thread overview]
Message-ID: <20230727105523-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CADSE00Jm45pbhvWgN8uQGjqZkEZr2UEHV2ARuqWheT-pXL-85Q@mail.gmail.com>
On Thu, Jul 27, 2023 at 04:48:30PM +0200, Albert Esteve wrote:
>
>
> On Mon, Jul 17, 2023 at 4:11 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
>
>
>
>
> On Mon, Jul 17, 2023 at 01:42:02PM +0200, Albert Esteve wrote:
> > Hi Michael,
> >
> > True. It may be a good idea to impose a limit in the number of entries
> that can
> > be added to the table.
> > And fail to add new entries once it reaches the limit.
> >
> > Not sure what would be a good limit though. For example, https://
> www.kernel.org
> > /doc/html/v4.9/media/uapi/v4l/vidioc-reqbufs.html#c.v4l2_requestbuffers
> > does not limit the number of buffers that can be allocated
> simultaneously, it
> > is an unsigned 32-bits value.
> > However, I guess 16-bits (65535) would suffice to cover the vast majority
> of
> > usecases. Or even lower, and
> > can be adjusted later, as this API gets (more) used.
> >
> > Does that make sense?
> >
> > Thanks.
> > BR,
> > Albert
>
> let's not top-post please.
>
> Maybe. Another concern is qemu running out of FDs with a bad backend.
>
> Question: why does qemu have to maintain these UUIDs in its memory?
>
> Can't it query the backend with UUID and get the fd back?
>
>
> In the end, we have one backend sharing an object with other backends.
> From the importer POV, it does not know who the exporter is, so it cannot
> go pocking other backends until it finds the one that is holding a resource
> with
> the same UUID, it relies on qemu providing this information.
>
> If we do not want qemu to hold the fds, we could, for instance, store
> references to
> backends that act as exporters. And then, once an importer requests for a
> specific
> object with its UUID, we ask for the fd to the exporter(s), hoping to find it.
right. I'd do this. and then the existing table can be regarded
as a cache.
> But the current solution sounds better fit to the shared objects virtio
> feature.
> I would be more keen to look into something like what Gerd suggested, limiting
> the memory that we use.
>
> Nonetheless, in qemu we are storing fds, and not mmaping the dmabufs.
> So I think limiting the number of entries should suffice, to ensure
> that we do not run out of FDs, and memory.
my point is you really don't know how much to limit it.
if there's ability to drop the entries then you
can do this, and cache things in memory.
>
>
> And then, the hash table in QEMU becomes just a cache
> to speed up lookups.
>
> --
> MST
>
>
next prev parent reply other threads:[~2023-07-27 15:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 7:34 [PATCH v4 0/4] Virtio shared dma-buf Albert Esteve
2023-06-26 7:34 ` [PATCH v4 1/4] uuid: add a hash function Albert Esteve
2023-06-26 7:34 ` [PATCH v4 2/4] virtio-dmabuf: introduce virtio-dmabuf Albert Esteve
2023-07-10 19:00 ` Michael S. Tsirkin
2023-07-17 13:59 ` Gerd Hoffmann
2023-06-26 7:34 ` [PATCH v4 3/4] vhost-user: add shared_object msg Albert Esteve
2023-07-10 19:03 ` Michael S. Tsirkin
2023-07-17 11:42 ` Albert Esteve
2023-07-17 14:10 ` Gerd Hoffmann
2023-07-17 14:11 ` Michael S. Tsirkin
2023-07-27 14:48 ` Albert Esteve
2023-07-27 14:56 ` Michael S. Tsirkin [this message]
2023-07-28 9:05 ` Albert Esteve
2023-06-26 7:34 ` [PATCH v4 4/4] vhost-user: refactor send_resp code Albert Esteve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230727105523-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=aesteve@redhat.com \
--cc=cohuck@redhat.com \
--cc=fam@euphon.net \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).