From patchwork Tue Aug 15 04:36:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Dingwall X-Patchwork-Id: 9900885 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 30D2A6038C for ; Tue, 15 Aug 2017 04:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E4528785 for ; Tue, 15 Aug 2017 04:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAC612878E; Tue, 15 Aug 2017 04:39:19 +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 54AAD28785 for ; Tue, 15 Aug 2017 04:39:19 +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 1dhTb7-0001T8-9T; Tue, 15 Aug 2017 04:36:57 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhTb6-0001T2-VN for xen-devel@lists.xen.org; Tue, 15 Aug 2017 04:36:57 +0000 Received: from [85.158.143.35] by server-9.bemta-6.messagelabs.com id 7C/49-03406-86A72995; Tue, 15 Aug 2017 04:36:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJIsWRWlGSWpSXmKPExsUSwPDXQze9alK kwc8WRYslHxezODB6HN39mymAMYo1My8pvyKBNaPjwQymgkN8FXPP72FsYPzO3cXIxSEk0M8o cXPHT7YuRk4OCQF5ib0L/zDD2K1PHzKCFEkIvGGS2PFzBliRkICHxLb1W1gg7AqJA9deskLY5 RKrmh6xg9gsAqoSX2ZtBathE9CWmH9yGthQEQFpiWufLzOC2MICWhIrZ6wGm8krYCyx6Mo+Zg hbUOLkzCdgvcwCVhJz78wAms8BZEtLLP/HAWKKCihL/PvKOoFRYBaShllIGmYhNECEtSRu/Hv JhCGsLfFw4lSosJvE78b4BYzsqxjVi1OLylKLdE31kooy0zNKchMzc3QNDcz0clOLixPTU3MS k4r1kvNzNzECg54BCHYwTr/sf4hRkoNJSZR3ftSkSCG+pPyUyozE4oz4otKc1OJDjDIcHEoSv OaVQDnBotT01Iq0zBxg/MGkJTh4lER431cApXmLCxJzizPTIVKnGC05Nqxe/4WJ407fBiB57e P2L0xCLHn5ealS4ryaIPMEQBoySvPgxsFSxCVGWSlhXkagA4V4ClKLcjNLUOVfMYpzMCoJ8+q DTOHJzCuB2/oK6CAmoIP6fHpBDipJREhJNTBu72pR139kdz3ZVfrgN4br9nt71R9d/5W0Qm6T 1Ta3i4d+7Pwlz5QbXLbqFvcSoYp/hbfV6yxYO3pncPPfZAtZ8L8v4lp5h0CUis2pKeXK2jNXl 6lIH6l45Rvqsm62YrHB9vnrI3/cmVn+dhVHzO2eojoZH44dpdmv9h25+11K+neEcjGXOYcSS3 FGoqEWc1FxIgBM9F3XDAMAAA== X-Env-Sender: james@dingwall.me.uk X-Msg-Ref: server-13.tower-21.messagelabs.com!1502771815!72053753!1 X-Originating-IP: [80.0.253.72] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21835 invoked from network); 15 Aug 2017 04:36:55 -0000 Received: from know-smtprelay-omc-8.server.virginmedia.net (HELO know-smtprelay-omc-8.server.virginmedia.net) (80.0.253.72) by server-13.tower-21.messagelabs.com with DHE-RSA-AES128-SHA encrypted SMTP; 15 Aug 2017 04:36:55 -0000 Received: from dingwall.me.uk ([82.47.84.47]) by know-smtprelay-8-imp with bizsmtp id xGcu1v00611G8Qq01Gcu2l; Tue, 15 Aug 2017 05:36:55 +0100 X-Originating-IP: [82.47.84.47] X-Authenticated-User: X-Spam: 0 X-Authority: v=2.1 cv=APW+KdU1 c=1 sm=1 tr=0 a=0bfgdX8EJi0Cr9X0x0jFDA==:117 a=0bfgdX8EJi0Cr9X0x0jFDA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=MKtGQD3n3ToA:10 a=KeKAF7QvOSUA:10 a=1UhrZpe2VIYA:10 a=ZZnuYtJkoWoA:10 a=cWRNjhkoAAAA:8 a=LM9EHm7x9GCA5nBb1DwA:9 a=CjuIK1q_8ugA:10 a=hAen3xr-VmAA:10 a=16dEzWQFiobov50zz74A:9 a=sVa6W5Aao32NNC1mekxh:22 Received: (qmail 14174 invoked from network); 15 Aug 2017 04:36:53 -0000 Received: from behemoth.dingwall.me.uk (192.168.1.5) by mail0.xen.dingwall.me.uk with SMTP; 15 Aug 2017 04:36:53 -0000 Received: by behemoth.dingwall.me.uk (Postfix, from userid 1000) id 61AB7D08C20; Tue, 15 Aug 2017 05:36:53 +0100 (BST) Date: Tue, 15 Aug 2017 05:36:53 +0100 From: James Dingwall To: xen-devel@lists.xen.org Message-ID: <20170815043652.GA36547@dingwall.me.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) Subject: [Xen-devel] [patch] honour maxmem from config 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, From xl.cfg(5): maxmem=MBYTES Specifies the maximum amount of memory a guest can ever see. The value of maxmem= must be equal or greater than memory=. In combination with memory= it will start the guest "pre-ballooned", if the values of memory= and maxmem= differ. At present when creating (pv) domains with a configuration such as: memory = 512 maxmem = 1024 The maximum memory of the guest will not go above 512 (this also shows in the maxmem column in xl top). I expect that the vm will start with 512 and then be able to increase up to 1024 if there is memory available for xen to allocate and the guest is under memory pressure. I have been carrying variations of this patch originally written by Wei Liu through 4.[345] and having just jumped to 4.8 noted it is still a problem so thought I would raise this again. With this applied everything is stable and working as expected - Xen 4.8.1 + Linux 4.1.43 (dom0 and guest) with tmem enabled in Xen, dom0 and guest. https://lists.xenproject.org/archives/html/xen-devel/2013-10/msg02228.html Thanks, James diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index d519c8d440..0b6d81e53a 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -416,7 +416,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, return ERROR_FAIL; } - if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + size) < 0) { + if (xc_domain_setmaxmem(ctx->xch, domid, info->max_memkb + size) < 0) { LOGE(ERROR, "Couldn't set max memory"); return ERROR_FAIL; }