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

Re: [PATCH RFC] x86+libxl: correct p2m (shadow) memory pool size calculation


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 22 Apr 2022 13:14:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mI5SyJacBSCo/wsyoSwR7GL/vzZDlGFK/IuOZiuFVso=; b=k6/KEEsm2ajTq5Yx5nu79l2XFkbnonwDR1zMtipQZ1dRKI0A3kehpl04j0FSaLUniXM1C7qR4bvy/9H7FaXFovnHrM9R5CIX0rHeWM6+YOQDo4TECg7Rk1P4GWQIE7O88v9GOCgFFJwbk4B4vPvIjR0rEeyEjL1VGat9fWMq/eEK8n0+MPVm5DQjWSKwLbkxcWTyUeRHaw9fMuV09GdQcxGa9MMzH+Sqf031mvhLDyyKN1cbWBvedUIre4BsDJDfbz7nH9myEnn8PY7xs3XnNqO82eELq6Ev5Rl7urKJTpMDC7j5BL+H/nqHI8ZR9TdTg+j2OO5vdT3Cu56fNjVtoA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nEsoZUdkCGwK/BlNc0MJBdHxI5XwannbkH61LgcoD3JqYaskfuuxHdwp/PicwSYujbIb9i7KBuEcuTClQiSGdRhE2ZC8f5AudYJCSEXaZXToHrWJKCEtWpym4WYpmOksDe1I5PBJs7RErWYr6L0FY+kWn2Rw+r7YT4ZoDFzyFzcDsFGh2Ggwzn+tjdnr85NvECeQAydJYbg9VBdBREe/1shJR3c2HTpvAjV9Y13E7S+jSnxt2m1FkQ+Xt9BKZsrtBn5IvajIgWIgNgBbBbdlq+ffBfehhG9P/3i2wgfsGVeDYP4GU7IyxlNaQuFW3gej2/OQiJVlMYwTsccRW6tvMg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 22 Apr 2022 11:15:13 +0000
  • Ironport-data: A9a23:5HFKNq82OAJeMERzW9FnDrUDh3+TJUtcMsCJ2f8bNWPcYEJGY0x3y jcZUWzTPPbcYGDzeop1YYng8kMBvpfSnNBnTFFv/Hw8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ54f5fs7Rh2NQw3YLjW1rlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnb6RTzYsJ/biobs+YgRpGQMkFpZ86LCSdBBTseTLp6HHW13F5qw3SWoRZMgf8OsxBnxS/ /sFLjxLdgqEm++93LO8TK9rm9gnK87oeogYvxmMzxmAVapgHc+FHvuMvIAAtNszrpkm8fL2f c0WZCApdB3dSxZOJk0WGNQ1m+LAanzXLWwA+QnI+/NfD2773lAhl7LEL9fuUfuoXudMgXvfg 0/f8DGsav0dHJnFodafyVqujOLSmSLwWKoJCaa1sPVthTW71mEVTREbS1a/if24kVKlHcJSL VQO/SgjprR081akJvHiWzWorXjCuQQTM/JSHPc98xql0bfP7kCSAW1sc9JaQNkvtctzTjtz0 FaMxortHWY27+XTTm+B/LCJqz/0ITISMWIJeS4DS00C/sXnp4YwyBnIS76PDZKIszE8Ihmoq xjikcT0r+x7YRIjv0ljwW36vg==
  • Ironport-hdrordr: A9a23:9ajYq6/J4Y3/PRHVW4Ruk+FEdb1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwXZVoZUmsjaKdgLNhRItKOTOLhILGFuFfBOfZsl7d8mjFh5VgPM RbAtRD4b/LfD9HZK/BiWHXcurIguP3lpxA7d2uskuFJjsaD52IgT0JaDpyRSZNNXN77NcCZe yhz/sCgwDlVWUcb8y9CHVAd+/fp+fTnJajRRIdHRYo5CSHkDvtsdfBYlCl9yZbdwkK7aYp8G DDnQC8zqK/s8ujwhuZ82PI9ZxZlPbo19MGLs2Rjco+LCnql2+TFc1ccozHmApwjPCk6V4snt WJixA8P/5r43eURW2xqQuF4XiU7B8er1vZjXOIi3rqpsL0ABggDdBauI5fehzFr2I9odBVys twri6knqsSKSmFsDX25tDOWR0vvFGzu2AenekaiGEaeZcCaYVWsZcU8CpuYdo99RrBmc4a+d RVfYDhDK48SyLbU5mZhBgk/DWUZAV9Iv/cKXJy+fB80FBt7QJEJgUjtY4id0w7hewAoql/lp v525tT5cBzp+8tHNZA7bQ6MLyK4lKke2O9DEuiZXLaKYogB1Xh77bK3ZRd3pDYRHVP9up4pK j8
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Apr 22, 2022 at 12:57:03PM +0200, Jan Beulich wrote:
> The reference "to shadow the resident processes" is applicable to
> domains (potentially) running in shadow mode only. Adjust the
> calculations accordingly.
> 
> In dom0_paging_pages() also take the opportunity and stop open-coding
> DIV_ROUND_UP().
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> RFC: I'm pretty sure I can't change a public libxl function (deprecated
>      or not) like this, but I also don't know how I should go about
>      doing so (short of introducing a brand new function and leaving the
>      existing one broken).

You have to play with LIBXL_API_VERSION, see for example:

1e3304005e libxl: Make libxl_retrieve_domain_configuration async

> 
> --- a/tools/include/libxl_utils.h
> +++ b/tools/include/libxl_utils.h
> @@ -23,7 +23,10 @@ const
>  #endif
>  char *libxl_basename(const char *name); /* returns string from strdup */
>  
> -unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, 
> unsigned int smp_cpus);
> +unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb,
> +                                               unsigned int smp_cpus,
> +                                               libxl_domain_type type,
> +                                               bool hap);

Iff we are to change this anyway, we might as well rename the
function and introduce a proper
libxl_get_required_{paging,p2m}_memory?

It seems wrong to have a function explicitly named 'shadow' that takes
a 'hap' parameter.

If you introduce a new function there's no need to play with the
LIBXL_API_VERSION and you can just add a new LIBXL_HAVE_FOO define.

Thanks, Roger.



 


Rackspace

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