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

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring


  • To: Carlo Nonato <carlo.nonato@xxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Jan 2023 17:29:00 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=Clb67/GwDZhUCARy9ALs3RG4LTif/9oZzrj/is0AU6w=; b=OTkjtIB0794/qaih+8fD2aM4hWqeUyo59UU9oj/dJNKRfmL2fNL8uWbZsxLwJP5fah+gizZyeR1q2+y7pBa8gJ5L0GgislcnHyvi/uNtIISMjzzEpIi5uULdys0477yjgARo+weROsIRr2p4YLN6d7jC2+eTjWE7qNDxNKQ4DXy7vDvsto1P4twP1KJi/C9L9B/UWTggCO13wBVqHbTUF6HIYDNIh1KBMS4NUImWGtsMZwLzGWVCIs8wrTGnNODaJf31fAzTviQl4o65+8ZAxM9KVmS5tlNNogLIfcSn4FSO62k2wPMl0UMQnwsdT1SLCx7qGYkTj9kfZ/o+xx81sA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZuLqPvXL8FplC6IKyC5xvbE35ZNegRogB5XclwRKmu8QdeP1tsO4ubymajP7tfFROnSoRnrINY4yC6Ktf6HWhrLoUGPS88iJ2n4VYxftY9Bp4h3sKQUUPsOTj4O3CEtiUF61XKJMTYJktgxyL7vWEVTVAO6XEyRMP/9TDHQXPfjbDxE2+qk7Z31MQW4Rl9v390H5jKo4MNNSa7/PyeSIVfTQqAuXa+85Ug0mRGHnoJSUfaVh1Z7KSTfqAEdySuYWPBsoFONf1jdus3SnKiyTxLUnSbXaDR+qr8PBRK4pKqultqLn++omCMI405iBSx9/HK77AXjz9u6ZwriRkNfMng==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marco Solieri <marco.solieri@xxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 24 Jan 2023 16:29:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.01.2023 16:47, Carlo Nonato wrote:
> @@ -275,6 +276,19 @@ unsigned int *dom0_llc_colors(unsigned int *num_colors)
>      return colors;
>  }
>  
> +unsigned int *llc_colors_from_guest(struct xen_domctl_createdomain *config)

const struct ...?

> +{
> +    unsigned int *colors;
> +
> +    if ( !config->num_llc_colors )
> +        return NULL;
> +
> +    colors = alloc_colors(config->num_llc_colors);

Error handling needs to occur here; the panic() in alloc_colors() needs
to go away.

> @@ -434,7 +436,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>              rover = dom;
>          }
>  
> -        d = domain_create(dom, &op->u.createdomain, false);
> +        if ( llc_coloring_enabled )
> +        {
> +            llc_colors = llc_colors_from_guest(&op->u.createdomain);
> +            num_llc_colors = op->u.createdomain.num_llc_colors;

I think you would better avoid setting num_llc_colors to non-zero if
you got back NULL from the function. It's at best confusing.

> @@ -92,6 +92,10 @@ struct xen_domctl_createdomain {
>      /* CPU pool to use; specify 0 or a specific existing pool */
>      uint32_t cpupool_id;
>  
> +    /* IN LLC coloring parameters */
> +    uint32_t num_llc_colors;
> +    XEN_GUEST_HANDLE(uint32) llc_colors;

Despite your earlier replies I continue to be unconvinced that this
is information which needs to be available right at domain_create.
Without that you'd also get away without the sufficiently odd
domain_create_llc_colored(). (Odd because: Think of two or three
more extended features appearing, all of which want a special cased
domain_create().)

Jan



 


Rackspace

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