qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Raphael Norwitz <raphael.s.norwitz@gmail.com>
To: Jiajun Chen <chenjiajun8@huawei.com>
Cc: zhang.zhanghailiang@huawei.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	jasowang@redhat.com, QEMU <qemu-devel@nongnu.org>,
	xiexiangyou@huawei.com, imammedo@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] vhost-user: add separate memslot counter for vhost-user
Date: Thu, 1 Oct 2020 22:05:50 -0400	[thread overview]
Message-ID: <CAFubqFs1Vac2xQspDBF5M1oxCH0O9jEhjPj5g0CD6RSHrqwEiQ@mail.gmail.com> (raw)
In-Reply-To: <20200928131731.69684-1-chenjiajun8@huawei.com>

On Mon, Sep 28, 2020 at 9:17 AM Jiajun Chen <chenjiajun8@huawei.com> wrote:
>
> Used_memslots is equal to dev->mem->nregions now, it is true for
> vhost kernel, but not for vhost user, which uses the memory regions
> that have file descriptor. In fact, not all of the memory regions
> have file descriptor.
> It is usefully in some scenarios, e.g. used_memslots is 8, and only
> 5 memory slots can be used by vhost user, it is failed to hot plug
> a new memory RAM because vhost_has_free_slot just returned false,
> but we can hot plug it safely in fact.
>
> --
> ChangeList:
> v3:
> -make used_memslots a member of struct vhost_dev instead of a global static value
>
> v2:
> -eliminating useless used_memslots_exceeded variable and used_memslots_is_exceeded() API
>
> v1:
> -vhost-user: add separate memslot counter for vhost-user
>
> Signed-off-by: Jiajun Chen <chenjiajun8@huawei.com>
> Signed-off-by: Jianjay Zhou <jianjay.zhou@huawei.com>

I'm happy with this from a vhost/vhost-user perspective. vhost-backend
change looks good too. I'm a little confused by what's going on with
net/vhost-user.c.

> ---
>  hw/virtio/vhost-backend.c         | 12 ++++++++++
>  hw/virtio/vhost-user.c            | 25 +++++++++++++++++++++
>  hw/virtio/vhost.c                 | 37 +++++++++++++++++++++++--------
>  include/hw/virtio/vhost-backend.h |  5 +++++
>  include/hw/virtio/vhost.h         |  1 +
>  net/vhost-user.c                  |  7 ++++++
>  6 files changed, 78 insertions(+), 9 deletions(-)
>

> diff --git a/net/vhost-user.c b/net/vhost-user.c
> index 17532daaf3..7e93955537 100644
> --- a/net/vhost-user.c
> +++ b/net/vhost-user.c
> @@ -20,6 +20,7 @@
>  #include "qemu/error-report.h"
>  #include "qemu/option.h"
>  #include "trace.h"
> +#include "include/hw/virtio/vhost.h"
>
>  typedef struct NetVhostUserState {
>      NetClientState nc;
> @@ -347,6 +348,12 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
>          qemu_chr_fe_set_handlers(&s->chr, NULL, NULL,
>                                   net_vhost_user_event, NULL, nc0->name, NULL,
>                                   true);

Can you elaborate on this check here? What does it have to do with
fixing memslots accounting? Maybe it should be in a separate change?

> +
> +        if (!vhost_has_free_slot()) {
> +            error_report("used memslots exceeded the backend limit, quit "
> +                         "loop");
> +            goto err;
> +        }
>      } while (!s->started);
>
>      assert(s->vhost_net);
> --
> 2.27.0.dirty
>


  reply	other threads:[~2020-10-02  2:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 13:17 [PATCH] vhost-user: add separate memslot counter for vhost-user Jiajun Chen
2020-10-02  2:05 ` Raphael Norwitz [this message]
2020-10-12 11:12   ` chenjiajun
2020-10-14  1:22     ` Raphael Norwitz
2020-10-06  9:48 ` Igor Mammedov
2020-10-14  0:58   ` Raphael Norwitz
2020-10-14  7:08     ` Michael S. Tsirkin
2020-10-14 16:11       ` Raphael Norwitz
2020-10-14 16:26         ` Michael S. Tsirkin
2020-10-14 17:21           ` Raphael Norwitz
2020-10-14 17:54             ` Michael S. Tsirkin
2020-10-21 14:34         ` Igor Mammedov
2020-10-30  8:39 ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2020-09-08  6:11 Jiajun Chen
2020-09-08  8:37 ` Michael S. Tsirkin
2020-09-15  1:27 ` Raphael Norwitz
2020-08-11  1:43 Jiajun Chen
2020-08-27 12:11 ` Michael S. Tsirkin
2020-09-02  5:02 ` Raphael Norwitz
2020-08-07  9:47 Jiajun Chen
2020-08-07  9:55 ` no-reply
2020-08-07  8:19 Jiajun Chen
2020-08-07  8:25 ` no-reply

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=CAFubqFs1Vac2xQspDBF5M1oxCH0O9jEhjPj5g0CD6RSHrqwEiQ@mail.gmail.com \
    --to=raphael.s.norwitz@gmail.com \
    --cc=chenjiajun8@huawei.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiexiangyou@huawei.com \
    --cc=zhang.zhanghailiang@huawei.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).