From: Ian Jackson Subject: Re: [PATCH 7/7] xl: Fix 'free_memory' to include outstanding_claims value. Date: Mon, 15 Apr 2013 12:41:59 +0100 Message-ID: <20843.59271.672380.158979@mariner.uk.xensource.com> References: <1365800181-9877-1-git-send-email-konrad.wilk@oracle.com> <1365800181-9877-8-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1365800181-9877-8-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: George Dunlap , Dan Magenheimer , "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org Konrad Rzeszutek Wilk writes ("[PATCH 7/7] xl: Fix 'free_memory' to include outstanding_claims value."): > Updating to make it clear that free_memory reported by 'xl info' > is influenced by the outstanding claim value. [...] > if (libxl_get_physinfo(ctx, &info) != 0) { > fprintf(stderr, "libxl_physinfo failed.\n"); > return; > } > - > + /* > + * Don't bother checking "claim_mode" as user might have turned it off > + * and we have outstanding claims. > + */ > + if ((claims = libxl_get_claiminfo(ctx)) < 0){ > + fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n", > + errno, strerror(errno)); > + return; > + } ... > + printf("free_memory : %"PRIu64"\n", (info.free_pages - claims) / i); This has a race, I think. Ian.