From: "Michael S. Tsirkin" <mst@redhat.com>
To: Raphael Norwitz <raphael.norwitz@nutanix.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation
Date: Wed, 19 Feb 2020 05:08:18 -0500 [thread overview]
Message-ID: <20200219050721-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200219053324.GA3052@localhost.localdomain>
On Wed, Feb 19, 2020 at 12:33:24AM -0500, Raphael Norwitz wrote:
> On Mon, Feb 10, 2020 at 11:04:28AM -0500, Michael S. Tsirkin wrote:
> >
> > On Sun, Feb 09, 2020 at 12:14:42PM -0500, Raphael Norwitz wrote:
> > > On Thu, Feb 06, 2020 at 03:33:13AM -0500, Michael S. Tsirkin wrote:
> > > >
> > > > On Wed, Jan 15, 2020 at 09:57:03PM -0500, Raphael Norwitz wrote:
> > > > >
> > > > > Changes since V1:
> > > > > * Kept the assert in vhost_user_set_mem_table_postcopy, but moved it
> > > > > to prevent corruption
> > > > > * Made QEMU send a single VHOST_USER_GET_MAX_MEMSLOTS message at
> > > > > startup and cache the returned value so that QEMU does not need to
> > > > > query the backend every time vhost_backend_memslots_limit is called.
> > > >
> > > > I'm a bit confused about what happens on reconnect.
> > > > Can you clarify pls?
> > > >
> > > >From what I can see, backends which support reconnect call vhost_dev_init,
> > > which then calls vhost_user_backend_init(), as vhost-user-blk does here:
> > > https://github.com/qemu/qemu/blob/master/hw/block/vhost-user-blk.c#L315. The
> > > ram slots limit is fetched in vhost_user_backend_init() so every time the
> > > device reconnects the limit should be refetched.
> >
> > Right. Point is, we might have validated using an old limit.
> > Reconnect needs to verify limit did not change or at least
> > did not decrease.
> >
> > --
> > MST
> Good point - I did not consider this case. Could we keep the slots limit in
> the VhostUserState instead?
>
> Say vhost_user_init() initializes the limit inside the VhostUserState to 0. Then,
> vhost_user_backend_init() checks if this limit is 0. If so, this is the initial
> connection and qemu fetches the limit from the backend, ensures the returned
> value is nonzero, and sets the limit the VhostUserState. If not, qemu knows this
> is a reconnect and queries the backend slots limit. If the returned value does
> not equal the limit in the VhostUserState, vhost_user_backend_init() returns an
> error.
>
> Thoughts?
Right.
Or if we really want to, check backend value is >= the saved one.
Basically same thing we do with features.
--
MST
prev parent reply other threads:[~2020-02-19 10:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 2:57 [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation Raphael Norwitz
2020-01-16 2:57 ` [PATCH v2 1/3] Fixed assert in vhost_user_set_mem_table_postcopy Raphael Norwitz
2020-02-06 8:17 ` Michael S. Tsirkin
2020-02-06 8:20 ` Michael S. Tsirkin
2020-02-09 17:17 ` Raphael Norwitz
2020-01-16 2:57 ` [PATCH v2 2/3] Refactor vhost_user_set_mem_table functions Raphael Norwitz
2020-02-06 8:21 ` Michael S. Tsirkin
2020-02-09 17:21 ` Raphael Norwitz
2020-01-16 2:57 ` [PATCH v2 3/3] Lift max memory slots limit imposed by vhost-user Raphael Norwitz
2020-02-06 8:32 ` Michael S. Tsirkin
2020-02-09 17:43 ` Raphael Norwitz
2020-02-20 7:03 ` Raphael Norwitz
2020-02-25 12:07 ` Michael S. Tsirkin
2020-01-31 21:21 ` [PATCH v2 0/3] vhost-user: Lift Max Ram Slots Limitation Raphael Norwitz
2020-02-06 8:33 ` Michael S. Tsirkin
2020-02-09 17:14 ` Raphael Norwitz
2020-02-10 16:04 ` Michael S. Tsirkin
2020-02-19 5:33 ` Raphael Norwitz
2020-02-19 10:08 ` Michael S. Tsirkin [this message]
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=20200219050721-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=raphael.norwitz@nutanix.com \
/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).