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

Re: [PATCH v3 06/12] x86/shadow: restrict OOS allocation to when it's really needed


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 20 Feb 2026 15:06:02 +0000
  • 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=arcselector10001; 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=auf12nDW0j9b06N6A3UqnFkazB6eYRZxm2r0QIcHvo8=; b=WhxAm8wILSnHff9cfQGC52636Ln+aJyrxMXOxMeVLNeBktCzATvyCOh4dXthpQavbFPe1Mv8Xtj7zvkDnzSwwE1E7ii2uwOjX9UCldXqB1PIffTxksb5OVIW+E0KDjOVy8H7tR2juXeelgP6djHUIqDNtz2+Dxuh0TFqexj+LUvxTj+rT6Q86rUH/YqTd+3FYlhC7ZRXaYyLBpim9FTSk7E/gsP0YC2gbUkRyh2P3cCz0qxb4TuNcM/XibllH+Sk7dRnVZ/uhsies1MsZJEWgGctugc3rSMp8OGn54oLUsusqUevXPahfMEtee9QVwR6GVu4HgdQxIznwlRsAzr2rg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iH7S/q2i/lLZNaDjPYywjY4FSiugjfq0YxZ8MkxJ1je7U3KuEwurIBCfpxZl7QELP2grud7VhzSbHw79wOmlDClm087P7SSwFIc8PGJtiX27+g+VGqA2f9cJmAbuHn7JqXQTN/9Ncg85tZoJDv5gch4r0wQJ0KVTRJaXD8EuVlfZwfpAXifYYwn4oYMAT5IHU6pyZ/0Nk5Txn5y2m+spdRKahW1M+dKbrOtTvDqU/is+MqGZctTb4SgTIzEXpzlFUr3hC+BCbN1jceeAMr275p1f7+ep5HMw16042MnYBbW+0gEvkeN03Ey1aoH1obg6YuXOxwwfq2GLbzM4MLuK/w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
  • Delivery-date: Fri, 20 Feb 2026 15:06:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/05/2023 8:40 am, Jan Beulich wrote:
> PV domains won't use it, and even HVM ones won't when OOS is turned off
> for them. There's therefore no point in putting extra pressure on the
> (limited) pool of memory.
>
> While there also zap the sh_type_to_size[] entry when OOS is disabled
> altogether.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> v3: New.
>
> --- a/xen/arch/x86/mm/shadow/common.c
> +++ b/xen/arch/x86/mm/shadow/common.c
> @@ -61,7 +61,9 @@ const uint8_t sh_type_to_size[] = {
>      [SH_type_l4_64_shadow]   = 1,
>      [SH_type_p2m_table]      = 1,
>      [SH_type_monitor_table]  = 1,
> +#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
>      [SH_type_oos_snapshot]   = 1,
> +#endif
>  };
>  #endif /* CONFIG_HVM */
>  
> @@ -1771,7 +1773,8 @@ static void sh_update_paging_modes(struc
>  #endif /* (SHADOW_OPTIMIZATIONS & SHOPT_VIRTUAL_TLB) */
>  
>  #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
> -    if ( mfn_eq(v->arch.paging.shadow.oos_snapshot[0], INVALID_MFN) )
> +    if ( !(d->options & XEN_DOMCTL_CDF_oos_off) &&
> +         mfn_eq(v->arch.paging.shadow.oos_snapshot[0], INVALID_MFN) )
>      {
>          int i;
>  
>

I've never seen XEN_DOMCTL_CDF_oos_off used.  Xapi has no plumbing for
this, and xl only inherited it from xend.

At this point, OOS is the tested path and OOS_OFF is the untested path. 
I think we should remove the flag and let OOS be unconditional like all
the other shadow optimisations.

~Andrew



 


Rackspace

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