From patchwork Wed Aug 22 10:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yi" X-Patchwork-Id: 10572517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDE41112E for ; Wed, 22 Aug 2018 02:16:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C25922B298 for ; Wed, 22 Aug 2018 02:16:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B60372B29E; Wed, 22 Aug 2018 02:16:49 +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=-1.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E87F2B298 for ; Wed, 22 Aug 2018 02:16:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 797986B21ED; Tue, 21 Aug 2018 22:16:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 71D276B21EE; Tue, 21 Aug 2018 22:16:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E4B46B21EF; Tue, 21 Aug 2018 22:16:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 1EF356B21ED for ; Tue, 21 Aug 2018 22:16:48 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id l65-v6so287942pge.17 for ; Tue, 21 Aug 2018 19:16:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=GsTG8lALSXFkkbPi8ZceiT5v9rNJDXjkmFjyPfdKasA=; b=J5RmVCCHAn92GOjKWTLVO95UgVmcXi6X+KG725FoGIdXMDnzC2L5mL0iFH93DcOJfo G8h9GT8d+QEH621p1EN0+YVrLONSzp6SifnuhWa84BJC+hke9DDQrv+koPlFuPWTEFRp 4Sxu5yVNi1WH0256EtJy2ktZafGcaTMs6oa7GJNybEJa+Feq3UjEzeRbbl+4LYg95BtC AMC5MIKJSEFKKzibccGbL+5etvg738j6Y0Qlh6ohphpBJgZHMJwqiuzSepW+8O52bYNv lKuHT4lxiSGdAMxvyLI8io8okJ8wRp9uCzxz0MXLjxyeYZhlBE6sOdg0VGGlMMuZJoJG qEVA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=yi.z.zhang@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AOUpUlGrkKj/hkTlpIRKYFo9yxrh2V/yNHMHUy7axaSBydOieNAZlU9C Y4cjoxW2/p6mKifTy4yfvz4As7qI1W1HGgHkSLtkvtqHnkDDKe6Tq7g+IIPRMaZS6zpAklTK+Zo imhaR07N0Hsr5p8h5bhN/1b1CLhTN/3c+akWrXJiH1S0ie9Lc+P4g78twcmvLtX0CLA== X-Received: by 2002:a65:6243:: with SMTP id q3-v6mr48807771pgv.273.1534904207834; Tue, 21 Aug 2018 19:16:47 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw5G1X8u4Fd1OnbCQfql0BzX4jugv21/YpieNbSlrBfaNoBNGvRz/Lzmm6+ppzpv1mbRrJ7 X-Received: by 2002:a65:6243:: with SMTP id q3-v6mr48807740pgv.273.1534904207063; Tue, 21 Aug 2018 19:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534904207; cv=none; d=google.com; s=arc-20160816; b=R3+n6j6K8CKFm67bIWQAL5J08zSO4vYzJVY0UMEyY3hUEbNiih09mTiz9vzEtWSq/8 e9tDpZYkcSHsxaOtm6vh0bLbl3SLv3zvpUemC4yK8wzk9uwbX9u9EI38c78v8/RnaVdG jEf/Dj5rjMERIEuLFKqOZ10AhV4tNsn01H6l88z3HN3GTMG3uzqIt5oLaggg4/sviX30 Q30EJtK880OaOxBwfJLhNGZONvxt6jd9Mpd8D5Q/LcTWTcWsP/BPD1xvuZMuH49we8vh SOXLpSVch5A1xJC+9L9Le6EQ3k1YLlqs0jD758VLxUJiCLaqnp1D89gu1pBGWH4dXrsD 8xAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GsTG8lALSXFkkbPi8ZceiT5v9rNJDXjkmFjyPfdKasA=; b=m00HCpTrPTdEVuBRGicBQ0oSEsrd2nQ4Ygdz32lr59uKoI4PlZlooyuYdDIBjpO2rA SXc4lzRZhIRg6FDLydSqXQDmTJGweJRquDbaH8C9b96LwoqIKWNSUlnme2a+/E+62dJ7 VJaqjfSmOnKARd/aD/3MGMoTj80CkH68llksMZOBNN3cfpXEdXU+JB9mlgUn9Cu/Uxwl oGz8o0ptsvU2NwNBDrsZGttYglOMiWxsm2EGBkVE+UGFFK6VR63xi7XuxNEXOHDg0E5j lYuUF5tteYEWuxJG/oIDhX70ucyj+5ALeP0Q3IF1b5bVhv+DF66vAitEvG9Mnso494zR iJIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=yi.z.zhang@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga01.intel.com (mga01.intel.com. [192.55.52.88]) by mx.google.com with ESMTPS id az1-v6si381379plb.456.2018.08.21.19.16.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 19:16:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 192.55.52.88 as permitted sender) client-ip=192.55.52.88; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 192.55.52.88 as permitted sender) smtp.mailfrom=yi.z.zhang@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Aug 2018 19:16:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,272,1531810800"; d="scan'208";a="68089377" Received: from linux.intel.com ([10.54.29.200]) by orsmga006.jf.intel.com with ESMTP; 21 Aug 2018 19:16:46 -0700 Received: from dazhang1-ssd.sh.intel.com (unknown [10.239.48.163]) by linux.intel.com (Postfix) with ESMTP id CD74A5802E1; Tue, 21 Aug 2018 19:16:42 -0700 (PDT) From: Zhang Yi To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, pbonzini@redhat.com, dan.j.williams@intel.com, dave.jiang@intel.com, yu.c.zhang@intel.com, pagupta@redhat.com, david@redhat.com, jack@suse.cz, hch@lst.de Cc: linux-mm@kvack.org, rkrcmar@redhat.com, jglisse@redhat.com, yi.z.zhang@intel.com, Zhang Yi Subject: [PATCH V4 1/4] kvm: remove redundant reserved page check Date: Wed, 22 Aug 2018 18:55:37 +0800 Message-Id: <26f79872e78cc643937059003763b5cfc1333167.1534934405.git.yi.z.zhang@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP PageReserved() is already checked inside kvm_is_reserved_pfn(), remove it from kvm_set_pfn_dirty(). Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu Reviewed-by: David Hildenbrand Acked-by: Pankaj Gupta --- virt/kvm/kvm_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8b47507f..c44c406 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1690,12 +1690,8 @@ EXPORT_SYMBOL_GPL(kvm_release_pfn_dirty); void kvm_set_pfn_dirty(kvm_pfn_t pfn) { - if (!kvm_is_reserved_pfn(pfn)) { - struct page *page = pfn_to_page(pfn); - - if (!PageReserved(page)) - SetPageDirty(page); - } + if (!kvm_is_reserved_pfn(pfn)) + SetPageDirty(pfn_to_page(pfn)); } EXPORT_SYMBOL_GPL(kvm_set_pfn_dirty);