From patchwork Thu Aug 31 13:16: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: 9932183 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 E09396022E for ; Thu, 31 Aug 2017 13:16:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D17A728867 for ; Thu, 31 Aug 2017 13:16:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5CE128913; Thu, 31 Aug 2017 13:16:09 +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 3895A28867 for ; Thu, 31 Aug 2017 13:16:09 +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 1dnPHp-00050y-MJ; Thu, 31 Aug 2017 13:13:33 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnPHo-00050W-D0 for xen-devel@lists.xen.org; Thu, 31 Aug 2017 13:13:32 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id FC/C3-03128-B7B08A95; Thu, 31 Aug 2017 13:13:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEIsWRWlGSWpSXmKPExsXSO6nOVbeae0W kwaxAiyUfF7M4MHoc3f2bKYAxijUzLym/IoE1o+HmNqaCOZwV7/7vZW1g/MrWxcjFISQwmUli 2/OLTBDOb0aJz58Os3YxcgI5GxklNr0sg0j0MEr8brgHlmATMJI4e3Q6I4gtIiAtce3zZUaQI maBBiaJ5+cOAjkcHMICnhKNU9hBTBYBVYlzB6VAynmBol8f9YCNkRBQkJjy8D0ziM0p4CWx9u 5lqL2eEkfWLmWCqDGWaH97kW0CI98CRoZVjBrFqUVlqUW6RqZ6SUWZ6RkluYmZObqGBmZ6uan FxYnpqTmJScV6yfm5mxiBYcIABDsYVy0IPMQoycGkJMr78PbySCG+pPyUyozE4oz4otKc1OJD jBocHAKb166+wCjFkpefl6okwSvCtSJSSLAoNT21Ii0zBxjIMKUSHDxKIrwmIGne4oLE3OLMd IjUKUZdjjt9G74wCYHNkBLnfcAJVCQAUpRRmgc3AhZVlxhlpYR5GYEOFOIpSC3KzSxBlX/FKM 7BqCTMaweyiiczrwRu0yugI5iAjoj1WgpyREkiQkqqgVGzy0T90jd266CFcQHAGD6r1vZpUqo os9YXbkY1gbQPIRv5HPrf6al+sWr7or2V9/WyWX1+O1ekWL/6+vbmiahoqdvHerJn3Qoz+HGl au2LqkNNp/tT/fl/nzm83NRl1+3zk7bw+hdOed+986l+0u4fc7iFlqt2bNrVY2YmqLxZ1Kv+d IpVthJLcUaioRZzUXEiACiOYcylAgAA X-Env-Sender: boris.ostrovsky@oracle.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1504185209!66565314!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 45250 invoked from network); 31 Aug 2017 13:13:30 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-2.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 31 Aug 2017 13:13:30 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7VDDNZn017158 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Aug 2017 13:13:24 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7VDDNFm028781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Aug 2017 13:13:23 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7VDDM6l004962; Thu, 31 Aug 2017 13:13:23 GMT Received: from ovs104.us.oracle.com (/10.149.76.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 31 Aug 2017 06:13:22 -0700 From: Boris Ostrovsky To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 09:16:14 -0400 Message-Id: <1504185374-7581-5-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504185374-7581-1-git-send-email-boris.ostrovsky@oracle.com> References: <1504185374-7581-1-git-send-email-boris.ostrovsky@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] 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 v2 4/4] mm: Don't request scrubbing until dom0 is running 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 There is no need to scrub pages freed during dom0 construction since once dom0 is ready the heap will be scrubbed by scrub_heap_pages() anyway, setting scrub_debug at the end. Signed-off-by: Boris Ostrovsky Reviewed-by: Wei Liu --- Changes in v2: * Use '||' instead of '|'. Drop '!!' * Clarified commit message. xen/common/page_alloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 2b8bb95..dbad1e1 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2248,16 +2248,12 @@ void free_domheap_pages(struct page_info *pg, unsigned int order) spin_unlock_recursive(&d->page_alloc_lock); -#ifndef CONFIG_SCRUB_DEBUG /* * Normally we expect a domain to clear pages before freeing them, * if it cares about the secrecy of their contents. However, after * a domain has died we assume responsibility for erasure. */ - scrub = !!d->is_dying; -#else - scrub = true; -#endif + scrub = d->is_dying || scrub_debug; } else {