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

Re: [PATCH v2 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs


  • To: Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 Aug 2022 15:49:29 +0200
  • 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=M5eNkD3eRytqFewYiVxIqpy3hnGIj7U1aRp2WIxnnew=; b=HkHu+VbgniLSYka/lZJ1BWxaRnQLb9NGrDfxK2x5lwBjMmTtKQ2MV3GUYLqIjJwtAT4kH9uotCrMe9JH7A9GBzwdJxgzuZOU9ZlqnZ0gq3Ws/p0XOPqTX26n+K7cuqKzsj1qg/201D9o/r6Az+RldZ98qvhpaqADG4V3qHLhSp5MKtCBMDTYnqq8I6XTU9R/5tV/3oziNc3fO9mHJwbB82Q+wWZWq3+ztmbFtCnTknEjih4Sx5FwwvJdjh+eQUI4g2lpkz9j3KViU9QPOLEf6myF/e0HPB/xQ8h6IY7hH5tWnadDN3BRfAk6HyUkCKqohNVTO4tHQRnl4djIt0eJuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nG4CO83SuwTmL3hsfys94M534oo9AEby2v35jQvbo+4H+oclF8XS7cgTcz62XPOs4NqfmJXoy2l+HfgJcH7xSycHt1UkjWjv1AnuDZ7h0u1wZJ2RHdCg5+LUdB8YBJCOhfRV7rz/UlEOSb8gnBzNsysv0V7h4zdu9uNoq4p813B6G3V0VVem0h1Ci3Cb6mpYfGLKGgVjq8aJ7UI23g9qKO3rZnzIk8dv2Y47MIMV3+koGh6mHdNpv6V+6uU5mvQG815UwRgj20T/8okHRrKs12wZBJl9XZFbXDQ6XGqw5OOlGV/MkO5dTHIf7AUNnKd0dQbLCfuhE3WmX6XOBDgTXQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 22 Aug 2022 13:49:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.08.2022 12:02, Rahul Singh wrote:
> Static event channel support will be added for dom0less domains.
> Restrict the maximum number of evtchn supported for domUs to avoid
> allocating a large amount of memory in Xen.

Please clarify here how you arrived at 4096 and why you expect no
dom0less DomU would ever want to have more. The limit, after all,
is far below that of FIFO event channels.

> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3277,7 +3277,7 @@ void __init create_domUs(void)
>          struct xen_domctl_createdomain d_cfg = {
>              .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
>              .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
> -            .max_evtchn_port = -1,
> +            .max_evtchn_port = MAX_EVTCHNS_PORT,
>              .max_grant_frames = -1,
>              .max_maptrack_frames = -1,
>              .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -76,6 +76,9 @@ extern domid_t hardware_domid;
>  /* Maximum number of event channels for any ABI. */
>  #define MAX_NR_EVTCHNS MAX(EVTCHN_2L_NR_CHANNELS, EVTCHN_FIFO_NR_CHANNELS)
>  
> +/* Maximum number of event channels supported for domUs. */
> +#define MAX_EVTCHNS_PORT 4096

I'm afraid the variable name doesn't express its purpose, and the
comment also claims wider applicability than is actually the case.
It's also not clear whether the constant really needs to live in
the already heavily overloaded xen/sched.h.

Jan



 


Rackspace

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