From patchwork Wed Sep 6 08:26: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: 9940093 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 47E236038C for ; Wed, 6 Sep 2017 08:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 364D428B1D for ; Wed, 6 Sep 2017 08:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AB4328B36; Wed, 6 Sep 2017 08:29:31 +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 89EA328B1D for ; Wed, 6 Sep 2017 08:29:29 +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 1dpVfU-0002SW-FN; Wed, 06 Sep 2017 08:26:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpVfT-0002Qb-4X for xen-devel@lists.xen.org; Wed, 06 Sep 2017 08:26:39 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 3F/85-01911-E31BFA95; Wed, 06 Sep 2017 08:26:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVyuP0Ov67txvW RBhdPGFgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmNZ++xFGzgqlh26yxLA+N8ji5GTg4JASOJ txP/MXUxcnEICSxklPi3eAIjSIJNQFViw/VTrCC2iIC0xLXPlxlBipgFHjNKNO/eA1YkLOAjM X3JDmYQmwWoYf/Wk0wgNq+AscTUXXOYIDbIS3QcmMwCYnMKmEjcfXKVDcQWAqqZvn4a4wRG7g WMDKsYNYpTi8pSi3SNDPSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M3MQI9XM/AwLi DsfmE3yFGSQ4mJVHey2rrI4X4kvJTKjMSizPii0pzUosPMWpwcAj0rVl9gVGKJS8/L1VJgjdw A1CdYFFqempFWmYOMARhSiU4eJREeLNA0rzFBYm5xZnpEKlTjJYcT95s/83E0fIWRH55Ou0Pk xDYPClxXieQBgGQhozSPLhxsDi5xCgrJczLyMDAIMRTkFqUm1mCKv+KUZyDUUmY1xNkCk9mXg nc1ldABzEBHVT1cg3IQSWJCCmpBsaMN2tWO6/vOzPZSDCx5tUym6wn63ovPu1z+3P7s0TKqqz MzQfnbf8h72T7UujP/o2KzaUuk0sDp/3+E/X6hRsvd6f//k7pmf5T7dfxX5h4xaIuQ4K7I5eN 58v87mh5wTVzUrbnaG98xCKis6ToFTPz72Vv7K7VJdsJ5R5gVOublmp3vtqwTFCJpTgj0VCLu ag4EQDu/wccjgIAAA== X-Env-Sender: jgross@suse.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1504686397!57928222!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 26560 invoked from network); 6 Sep 2017 08:26:37 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-9.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 6 Sep 2017 08:26:37 -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 86688AE73; Wed, 6 Sep 2017 08:26:37 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xen.org Date: Wed, 6 Sep 2017 10:26:29 +0200 Message-Id: <20170906082632.6494-6-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170906082632.6494-1-jgross@suse.com> References: <20170906082632.6494-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, jbeulich@suse.com Subject: [Xen-devel] [PATCH v2 5/8] xen: double default grant frame limit for huge hosts 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 In case a system has memory above the 16TB boundary double the default grant frame number limit per domain. This ensures a pv domain can still establish the same number of grants even if it is required to use version 2 grants which need twice the space of v1 grants. Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant --- xen/common/grant_table.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index ae5f1262e8..709fd55490 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -3824,8 +3824,15 @@ static int __init gnttab_usage_init(void) { BUILD_BUG_ON(DEFAULT_MAX_MAPTRACK_FRAMES < DEFAULT_MAX_NR_GRANT_FRAMES); + /* + * In case grant v2 is required for pv domains to reference any possible + * memory page (i.e. memory is installed above 16TB boundary) double the + * grant frame limit. This will allow a guest using v2 grants without + * having to lower the number of usable grants. + */ if ( !max_grant_frames ) - max_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES; + max_grant_frames = ((max_page >> 32) ? 2 : 1) * + DEFAULT_MAX_NR_GRANT_FRAMES; if ( !max_maptrack_frames ) max_maptrack_frames = DEFAULT_MAX_MAPTRACK_FRAMES;