From nobody Sun Feb 8 22:59:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1586161648; cv=none; d=zohomail.com; s=zohoarc; b=h8o7L9zWpWfbXejAehCmsVdjc/2Thnc0TK94Le36VyFRzwwsS675PbFqoCXuTDAhfzDUfTLpS5YEmzxvY9RpVqqkjKZYLerdTvkjp4rdYziNiugQaUke8QtHccALVEYGQiml5TmSxVex8Vse4xFeP9fh6GfSqNVApHpX/0Twbbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586161648; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=/b4+dwEQHtlERJ+DGS/ms3wy+WIQx2fmRIwZzOho23g=; b=jRl0jOaAVM+21paIDZr2Z1Ee4C6OMAP4q2N4CfSRV1Y2yqe44J1JjkF1LTXg5ScH9Uvfinf9TrAZW8LSBvXek/+/7hhSj5ZHSHDLbFYyrWDvgzFoh4982Bg1WStfIV/RfD+i6TPWIWDUzB/sqznLZlz9iDD9mI6gYOjLK4M+vg8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 158616164871017.968139506696957; Mon, 6 Apr 2020 01:27:28 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jLN67-00032L-22; Mon, 06 Apr 2020 08:27:11 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jLN66-000325-9g for xen-devel@lists.xenproject.org; Mon, 06 Apr 2020 08:27:10 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 672752a8-77e0-11ea-bfd7-12813bfff9fa; Mon, 06 Apr 2020 08:27:08 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9DFAFAB8F; Mon, 6 Apr 2020 08:27:06 +0000 (UTC) X-Inumbo-ID: 672752a8-77e0-11ea-bfd7-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Subject: [PATCH v2] tools/libxl: make default of max event channels dependant on vcpus Date: Mon, 6 Apr 2020 10:27:04 +0200 Message-Id: <20200406082704.13994-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Anthony PERARD , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since Xen 4.4 the maximum number of event channels for a guest is defaulting to 1023. For large guests with lots of vcpus this is not enough, as e.g. the Linux kernel uses 7 event channels per vcpu, limiting the guest to about 140 vcpus. Instead of requiring to specify the allowed number of event channels via the "event_channels" domain config option, make the default depend on the maximum number of vcpus of the guest. This will require to use the "event_channels" domain config option in fewer cases as before. As different guests will have differing needs the calculation of the maximum number of event channels can be a rough estimate only, currently based on the Linux kernel requirements. Nevertheless it is much better than the static upper limit of today as more guests will boot just fine with the new approach. In order not to regress current configs use 1023 as the minimum default setting. Signed-off-by: Juergen Gross --- V2: - use max() instead of min() - clarify commit message a little bit --- tools/libxl/libxl_create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index e7cb2dbc2b..c025b21894 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -226,7 +226,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, b_info->iomem[i].gfn =3D b_info->iomem[i].start; =20 if (!b_info->event_channels) - b_info->event_channels =3D 1023; + b_info->event_channels =3D max(1023, b_info->max_vcpus * 8 + 255); =20 libxl__arch_domain_build_info_setdefault(gc, b_info); libxl_defbool_setdefault(&b_info->dm_restrict, false); --=20 2.16.4