[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/libs/light: update xenstore entry when setting max domain memory


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 7 Apr 2022 15:44:39 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 07 Apr 2022 14:44:57 +0000
  • Ironport-data: A9a23:p+ZG5KqAOC1LqEjzCUv4WlA+EvVeBmJgZRIvgKrLsJaIsI4StFCzt garIBmGb/yJZjTwKIhyaIm+oxlTvMLTztQxHQVu/y00HiwSpJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrZRbrJA24DjWVvR4 Yyq+aUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBA6LqyMdEfyViMg5TAYZHpJP2I2jmmJnGp6HGWyOEL/RGCUg3OcsT+/ptAHEI/ vsdQNwPRknd3aTsmuv9E7QywJR4RCXoFNp3VnVIxDfFDfEgUNbbTr/D/9Nw1zYsnMFeW/3ZY qL1bBIxPE6fO0IUYD/7DroBw8u4pD7DbQdXpXfKn7cd2mzCw09+he2F3N39JYXRGJQ9clyjj n3C13T0BFcdLtP34SqI9Degi/HCmQv/WZkOD/uo+/hymlqRy2cPThoMWjOTo/ajjVWlc8lCM EFS8S0rxZXe72TyEIO7BUfh5ifZ4FhMALK8DtHW9imwxYyEwF+1OlIlYRN9Q916mP40VWUDg wrhc8zSORRjt7icSHS4/7iSrC+vNSV9EVLudRPoXiNevYC9/dhbYgbnC486TfXr1oGd9STYm WjikcQou1kEYSfnPY2f9EuPvT+jr4OhouUdtlSOBTLNAu+UieeYi22UBbrzsK4owGWxFADpU J04dy62tr1m4XalznHlfQn1NOv1j8tpyRWF6bKVI7Ev9i6251modp1K7Td1KS9Ba5hYKGW5P RKD5lwIvfe/2UdGi4ctPupd7Oxwk8Dd+SnNDKiIPrKinLAvHON4wM2eTRHJhD28+KTduao+J Y2aYa6R4YUyUsxaIM6Nb75Fi9cDn3lmrUuKHMyT50n3gNK2OS/OIZ9YYQTmUwzMxP7dyOkj2 40EbJXiJtQ2eLCWXxQ7BqZPdQtaciVhXcmeRg4+XrfrHzeK0VoJU5f5qY7NsaQ/90iJvo8kJ k2AZ3I=
  • Ironport-hdrordr: A9a23:KSrRxqPcmPOwgsBcTsOjsMiBIKoaSvp037Eqv3oRdfVwSL3+qy nOpoV+6faaslossR0b9uxofZPwJ080lqQFhLX5X43SPzUO0VHAROoJgLcKgQeQeREWntQtrJ uIGJIfNDSfNzZHsfo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Mar 31, 2022 at 09:07:55AM +0200, Juergen Gross wrote:
> libxl_domain_setmaxmem() should update the domain's memory/static-max
> Xenstore node, as otherwise "xl mem-set" won't be able to set the
> memory size to the new maximum.

`xl mem-set` doesn't call libxl_domain_setmaxmem(), but calls
libxl_set_memory_target().

Or maybe you are speaking about `xl mem-max` followed by `xl mem-set`?
In this case, it is documented in `man 1 xl` that `mem-max` has no
effect to `mem-set`.

quote from man, about `xl mem-max`:
    It is allowed to be higher than the configured maximum
    memory size of the domain (B<maxmem> parameter in the domain's
    configuration). Note however that the initial B<maxmem> value is still
    used as an upper limit for B<xl mem-set>.  Also note that calling B<xl
    mem-set> will reset this value.

> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
>  tools/libs/light/libxl_mem.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/tools/libs/light/libxl_mem.c b/tools/libs/light/libxl_mem.c
> index c739d00f39..2f4f9d4a4a 100644
> --- a/tools/libs/light/libxl_mem.c
> +++ b/tools/libs/light/libxl_mem.c
> @@ -82,6 +82,15 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, 
> uint64_t max_memkb)

There's a comment on this functions:
    /*
     * Set the maximum memory size of the domain in the hypervisor. There is no
     * change of the current memory size involved. The specified memory size can
     * even be above the configured maxmem size of the domain, but the related
     * Xenstore entry memory/static-max isn't modified!
     */
    int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t 
max_memkb)

So it was already known that "static-max" wasn't set.
At the very least, this comment needs updating.

>          goto out;
>      }
>  
> +    rc = libxl__xs_printf(gc, XBT_NULL,
> +                          GCSPRINTF("%s/memory/static-max", dompath),
> +                          "%"PRIu64, max_memkb);
> +    if (rc != 0) {
> +        LOGED(ERROR, domid, "Couldn't set %s/memory/static-max, rc=%d\n",
> +              dompath, rc);
> +        goto out;



So, I don't know whether increasing "static-max" is fine or not, but
according to the documentation, it isn't expected.

Is a guest fine with "static-max" been changed?

If yes, there's documentation and comments that needs to change with the
code change.

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.