From patchwork Tue Aug 29 17:09:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Ostrovsky X-Patchwork-Id: 9927775 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 091DD603B4 for ; Tue, 29 Aug 2017 17:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50DCF289DA for ; Tue, 29 Aug 2017 17:10:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F86E289D9; Tue, 29 Aug 2017 17:10:17 +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, UNPARSEABLE_RELAY 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 D58BD289CF for ; Tue, 29 Aug 2017 17:10:13 +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 1dmjyA-00053L-U0; Tue, 29 Aug 2017 17:06:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmjy9-00052s-NC for xen-devel@lists.xen.org; Tue, 29 Aug 2017 17:06:29 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 8C/5C-02041-41F95A95; Tue, 29 Aug 2017 17:06:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRWlGSWpSXmKPExsXSO6nOVVdk/tJ Ig84FQhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8ahOfNZC+byVNycfIK9gfENZxcjJ4eQwEQm iZ6f9V2MXED2X0aJ0+8eskM4GxklersfMEE4PYwSb1afYQRpYRMwkjh7dDqYLSIgLXHt82VGk CJmgQYmiefnDoIlhAWsJK59ucMMYrMIqEp8OzwNzOYV8JJouv+YBcSWEFCQmPLwPVicU8Bb4u 6s+4wQN3lJzFnezAZRYyjxeeNS5gmMfAsYGVYxahSnFpWlFukaGeglFWWmZ5TkJmbm6BoaGOv lphYXJ6an5iQmFesl5+duYgQGSz0DA+MOxuYTfocYJTmYlER5q6YujRTiS8pPqcxILM6ILyrN SS0+xCjDwaEkwes1DygnWJSanlqRlpkDDFuYtAQHj5IIbyhImre4IDG3ODMdInWKUVFKnFcTJ CEAksgozYNrg8XKJUZZKWFeRgYGBiGegtSi3MwSVPlXjOIcjErCvD4gU3gy80rgpr8CWswEtD jWC2xxSSJCSqqBcc5x3mPuX+50cFvPmKxqZMm4cfudRTzNngmcNRvLMm/pRYkVhqjvWPv5WdN cOYaiiBT/4tb2+4malfxLL89kq3WWn7hP74vd8stLFj34YL0sQHDBnNySGrdNOtytlj8nzqt6 E9wn4r965amm/1qbBC+Eyz8x3tJ3YfEW+WOvdufO25w211HmohJLcUaioRZzUXEiAP4H9O6QA gAA X-Env-Sender: boris.ostrovsky@oracle.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1504026386!108936576!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34506 invoked from network); 29 Aug 2017 17:06:28 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 29 Aug 2017 17:06:28 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7TH6MFM026258 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 17:06:22 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7TH6LZC002658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Aug 2017 17:06:21 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7TH6KAJ026735; Tue, 29 Aug 2017 17:06:20 GMT Received: from ovs104.us.oracle.com (/10.149.76.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Aug 2017 10:06:20 -0700 From: Boris Ostrovsky To: xen-devel@lists.xen.org Date: Tue, 29 Aug 2017 13:09:14 -0400 Message-Id: <1504026557-11365-3-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504026557-11365-1-git-send-email-boris.ostrovsky@oracle.com> References: <1504026557-11365-1-git-send-email-boris.ostrovsky@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: 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, Boris Ostrovsky Subject: [Xen-devel] [PATCH 2/5] mm: Change boot_scrub_done definition 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 Rename it to the more appropriate scrub_debug and define as a macro for !CONFIG_SCRUB_DEBUG. This will allow us to get rid of some ifdefs (here and in the subsequent patch). Signed-off-by: Boris Ostrovsky Suggested-by: Jan Beulich Reviewed-by: Wei Liu --- New in v2 xen/common/page_alloc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index e1f7cd2..a4a193b 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -171,7 +171,9 @@ static unsigned long __initdata opt_bootscrub_chunk = MB(128); size_param("bootscrub_chunk", opt_bootscrub_chunk); #ifdef CONFIG_SCRUB_DEBUG -static bool __read_mostly boot_scrub_done; +static bool __read_mostly scrub_debug; +#else +#define scrub_debug false #endif /* @@ -725,7 +727,7 @@ static void check_one_page(struct page_info *pg) const uint64_t *ptr; unsigned int i; - if ( !boot_scrub_done ) + if ( !scrub_debug ) return; ptr = map_domain_page(mfn); @@ -1696,12 +1698,7 @@ static void init_heap_pages( nr_pages -= n; } -#ifndef CONFIG_SCRUB_DEBUG - free_heap_pages(pg + i, 0, false); -#else - free_heap_pages(pg + i, 0, boot_scrub_done); -#endif - + free_heap_pages(pg + i, 0, scrub_debug); } } @@ -1968,7 +1965,7 @@ static void __init scrub_heap_pages(void) printk("done.\n"); #ifdef CONFIG_SCRUB_DEBUG - boot_scrub_done = true; + scrub_debug = true; #endif }