From patchwork Mon Mar 14 20:29:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8583741 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A9CA4C0554 for ; Mon, 14 Mar 2016 20:32:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAB782034B for ; Mon, 14 Mar 2016 20:32:17 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 69A98201ED for ; Mon, 14 Mar 2016 20:32:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afZ7Y-0008GE-9u; Mon, 14 Mar 2016 20:29:44 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afZ7W-0008G7-QC for xen-devel@lists.xen.org; Mon, 14 Mar 2016 20:29:42 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 61/8D-20731-63F17E65; Mon, 14 Mar 2016 20:29:42 +0000 X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1457987380!14479523!1 X-Originating-IP: [209.85.161.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18840 invoked from network); 14 Mar 2016 20:29:41 -0000 Received: from mail-yw0-f194.google.com (HELO mail-yw0-f194.google.com) (209.85.161.194) by server-16.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 14 Mar 2016 20:29:41 -0000 Received: by mail-yw0-f194.google.com with SMTP id s188so12843084ywe.2 for ; Mon, 14 Mar 2016 13:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jai8QOuhrlSIr7M855P8unyJ3iMuZf5SLHWbKPnuaZ0=; b=HocXc9mTpYNLV6l0ZRfhDac4ptqDfiRzVanxxvFX0v76A6hOJg6TxZXsIP7Zke2fyr SPIu1dGr4GED/zrlrpMtb3PRPNwD8Dr2+RC1IhjHb14diqlXpjlnP5qxsVbWuHHsF6p2 7+ftS89TcNfD5azRQHZizlxxeheJFIp582wU0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jai8QOuhrlSIr7M855P8unyJ3iMuZf5SLHWbKPnuaZ0=; b=aCnfjGWGGNxe+WHC+ex5etotXqGvLDaviQpiJVORm/yBkm/ZxHPYmFJkqoRlSY5LQZ 08dvIgQLOQr6kdr43RTeHUjIsg/yl93ZOT1u4P0/33mlg5Et3uVN77b2TUHEknw0O4Bg 1Oz62lbU3QyTt9AQR7Q7j13Zy1KPvYAUfniBzFBYTg00Lluj5W9GuIYJrovqG+s5q5/I Zs2fvjnuW0HZqKtu+D9kUPLLO+sFxmoFY76dA5/frBWZiIdLrz7kdkLXMS46WBD0mK9y VNUlfvPxbIHnd3JF2jqP0KcUazuO17a29+gUC5YUxvlCzTOOgo0f5U3MOvbFW6n/aEbL xdcA== X-Gm-Message-State: AD7BkJLJtsT500D7VKLZFVpZ9132j12IHtQnLWByDQQ84o9r5Y0nFNAHnF9gJATvKrEFQQ== X-Received: by 10.13.228.196 with SMTP id n187mr14856404ywe.9.1457987380482; Mon, 14 Mar 2016 13:29:40 -0700 (PDT) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id v63sm15131124ywf.40.2016.03.14.13.29.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Mar 2016 13:29:39 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Mon, 14 Mar 2016 15:29:22 -0500 Message-Id: <1457987365-866-3-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1457987365-866-1-git-send-email-cardoe@cardoe.com> References: <1457987365-866-1-git-send-email-cardoe@cardoe.com> Cc: Keir Fraser , Doug Goldstein , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH 2/5] tmem: drop direct usage of opt_tmem 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-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_BL_SPAMCOP_NET, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Don't use the opt_tmem variable to check if tmem is enabled, instead use the tmem_enabled() helper function everywhere. Signed-off-by: Doug Goldstein --- CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Konrad Rzeszutek Wilk --- xen/arch/x86/setup.c | 2 +- xen/common/memory.c | 2 +- xen/common/page_alloc.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 5485468..7181624 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1243,7 +1243,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) init_domheap_pages(s, e); } - if ( opt_tmem ) + if ( tmem_enabled() ) { printk(XENLOG_WARNING "TMEM physical RAM limit exceeded, disabling TMEM\n"); diff --git a/xen/common/memory.c b/xen/common/memory.c index ef57219..c7fca96 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -202,7 +202,7 @@ static void populate_physmap(struct memop_args *a) if ( unlikely(!page) ) { - if ( !opt_tmem || a->extent_order ) + if ( !tmem_enabled() || a->extent_order ) gdprintk(XENLOG_INFO, "Could not allocate order=%u extent: id=%d memflags=%#x (%u of %u)\n", a->extent_order, d->domain_id, a->memflags, diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 22e8feb..1e6246e 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -652,7 +652,7 @@ static void __init setup_low_mem_virq(void) static void check_low_mem_virq(void) { unsigned long avail_pages = total_avail_pages + - (opt_tmem ? tmem_freeable_pages() : 0) - outstanding_claims; + (tmem_enabled() ? tmem_freeable_pages() : 0) - outstanding_claims; if ( unlikely(avail_pages <= low_mem_virq_th) ) { @@ -738,7 +738,7 @@ static struct page_info *alloc_heap_pages( * Others try tmem pools then fail. This is a workaround until all * post-dom0-creation-multi-page allocations can be eliminated. */ - if ( opt_tmem && ((order == 0) || (order >= 9)) && + if ( tmem_enabled() && ((order == 0) || (order >= 9)) && (total_avail_pages <= midsize_alloc_zone_pages) && tmem_freeable_pages() ) goto try_tmem; @@ -984,7 +984,7 @@ static void free_heap_pages( avail[node][zone] += 1 << order; total_avail_pages += 1 << order; - if ( opt_tmem ) + if ( tmem_enabled() ) midsize_alloc_zone_pages = max( midsize_alloc_zone_pages, total_avail_pages / MIDSIZE_ALLOC_FRAC); @@ -1755,7 +1755,7 @@ int assign_pages( { if ( unlikely((d->tot_pages + (1 << order)) > d->max_pages) ) { - if ( !opt_tmem || order != 0 || d->tot_pages != d->max_pages ) + if ( !tmem_enabled() || order != 0 || d->tot_pages != d->max_pages ) gprintk(XENLOG_INFO, "Over-allocation for domain %u: " "%u > %u\n", d->domain_id, d->tot_pages + (1 << order), d->max_pages);