From patchwork Fri Sep 22 11:41:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9965839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74A5B6035E for ; Fri, 22 Sep 2017 11:43:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8163E2987F for ; Fri, 22 Sep 2017 11:43:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7635229883; Fri, 22 Sep 2017 11:43:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F053E2987F for ; Fri, 22 Sep 2017 11:43:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvMKz-0002Il-OG; Fri, 22 Sep 2017 11:41:41 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvMKy-0002Ha-O5 for xen-devel@lists.xenproject.org; Fri, 22 Sep 2017 11:41:40 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id AC/E4-02224-3F6F4C95; Fri, 22 Sep 2017 11:41:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRWlGSWpSXmKPExsVyuP0Ov+7nb0c iDTb9FrH4vmUykwOjx+EPV1gCGKNYM/OS8isSWDO+L60umCxV8WD5FfYGxt2iXYycHBICRhJv J/5j6mLk4hASWMgosffNLmaQBJuAqsSG66dYQWwRASWJe6smgxUxC/xklPg2cSEbSEJYwFHiy IM37CA2C1DD10mtYHFeAWOJKZfmskBskJfoODAZzOYUMJG4sf0FWL0QUM2jg/fZJjByL2BkWM WoUZxaVJZapGtkoJdUlJmeUZKbmJmja2hgrJebWlycmJ6ak5hUrJecn7uJEejfegYGxh2MzSf 8DjFKcjApifLmfj4SKcSXlJ9SmZFYnBFfVJqTWnyIUYODQ6BvzeoLjFIsefl5qUoSvH7AMBIS LEpNT61Iy8wBBiBMqQQHj5IIrzxImre4IDG3ODMdInWK0Zjj2KbLf5g4Om7e/cMkBDZJSpzXB KRUAKQ0ozQPbhAsMi4xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEub9+BVoCk9mXgncvldApz ABnVK+GuyUkkSElFQD44zvxzKeSK/VVJ16bsb70yG7lE5bxgr48Us7nHu+KnuvxQqBe7Ozm+2 CXvX8jtx4V37lZd9pirosk1SSlT40vs3Yc+t7zdT2QB35y9NfeZ+Vz/M9L59i6RSXu1Hj7PPS XWyhssvuzPP/OfXrYfG5RXzXLrXvFVcTiv1RErn17K7L18WyHB6x/1BiKc5INNRiLipOBABJD xXShwIAAA== X-Env-Sender: jgross@suse.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1506080499!116046842!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59930 invoked from network); 22 Sep 2017 11:41:39 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-3.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 22 Sep 2017 11:41:39 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 153E7ACC3; Fri, 22 Sep 2017 11:41:39 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 22 Sep 2017 13:41:29 +0200 Message-Id: <20170922114134.9577-6-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170922114134.9577-1-jgross@suse.com> References: <20170922114134.9577-1-jgross@suse.com> Cc: Juergen Gross , sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, julien.grall@arm.com, jbeulich@suse.com, dgdegra@tycho.nsa.gov Subject: [Xen-devel] [PATCH v9 05/10] xl: add global grant limit config items X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add xl.conf config items for default values of grant limits: max_grant_frames will set the default for the maximum number of grant frames for a domain which will take effect if the domain's config file doesn't specify a value. If max_grant_frames isn't set in xl.conf it will default to 32 for hosts with all memory below 16TB and to 64 for hosts with memory above 16TB. max_maptrack_frames will set the default for the maximum number of maptrack frames for a domain. If max_maptrack_frames isn't set in xl.conf it will default to 0, as normally only backend domains need maptrack frames. Signed-off-by: Juergen Gross Acked-by: Ian Jackson Acked-by: Wei Liu --- V7: - don't use xc_maximum_ram_page() but max_possible_mfn from physinfo --- docs/man/xl.conf.pod.5 | 12 ++++++++++++ tools/xl/xl.c | 15 +++++++++++++++ tools/xl/xl.h | 2 ++ 3 files changed, 29 insertions(+) diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5 index 88ab506609..fe2cf27ea4 100644 --- a/docs/man/xl.conf.pod.5 +++ b/docs/man/xl.conf.pod.5 @@ -77,6 +77,18 @@ operations (primarily domain creation). Default: C +=item B + +Sets the default value for the C domain config value. + +Default: C<32> on hosts up to 16TB of memory, C<64> on hosts larger than 16TB + +=item B + +Sets the default value for the C domain config value. + +Default: C<0> + =item B Configures the default hotplug script used by virtual network devices. diff --git a/tools/xl/xl.c b/tools/xl/xl.c index 02179a6229..c1bbb4b939 100644 --- a/tools/xl/xl.c +++ b/tools/xl/xl.c @@ -45,6 +45,8 @@ char *default_colo_proxy_script = NULL; enum output_format default_output_format = OUTPUT_FORMAT_JSON; int claim_mode = 1; bool progress_use_cr = 0; +int max_grant_frames = -1; +int max_maptrack_frames = 0; xentoollog_level minmsglevel = minmsglevel_default; @@ -88,6 +90,7 @@ static void parse_global_config(const char *configfile, XLU_Config *config; int e; const char *buf; + libxl_physinfo physinfo; config = xlu_cfg_init(stderr, configfile); if (!config) { @@ -188,6 +191,18 @@ static void parse_global_config(const char *configfile, xlu_cfg_replace_string (config, "colo.default.proxyscript", &default_colo_proxy_script, 0); + if (!xlu_cfg_get_long (config, "max_grant_frames", &l, 0)) + max_grant_frames = l; + else { + libxl_physinfo_init(&physinfo); + max_grant_frames = (libxl_get_physinfo(ctx, &physinfo) != 0 || + !(physinfo.max_possible_mfn >> 32)) + ? 32 : 64; + libxl_physinfo_dispose(&physinfo); + } + if (!xlu_cfg_get_long (config, "max_maptrack_frames", &l, 0)) + max_maptrack_frames = l; + xlu_cfg_destroy(config); } diff --git a/tools/xl/xl.h b/tools/xl/xl.h index 31d660b89a..6b60d1db50 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -275,6 +275,8 @@ extern char *default_vifbackend; extern char *default_remus_netbufscript; extern char *default_colo_proxy_script; extern char *blkdev_start; +extern int max_grant_frames; +extern int max_maptrack_frames; enum output_format { OUTPUT_FORMAT_JSON,