Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1591777imm; Fri, 7 Sep 2018 02:59:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbXKFuZ/qRvTXX2hmxULcAob07GZW0d6ai7tuLKbgd6SnwG7lzKAnFDkUv//mEg51HWR3vA X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr7459800pgf.442.1536314340250; Fri, 07 Sep 2018 02:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536314340; cv=none; d=google.com; s=arc-20160816; b=B7eCgpkgW6u4sLg1O+lJ8t8Stfw40FIp74yfaRrRp+0qjEdz5xsFG1ucnkhMB3xINr M/SxpCIcciowgcArwUl3My/kPXZxUuXKYQiswhpTxYzfId7PCL0oeGHqJtsEDo6aC0wo WRFVGsO3RssJvXYX2P8w18gioJhEjzPTic8rdvxtWDazllKjIsK+C6MdJVyk/vH8RDAS CNTC5Ym2gWl0QHi29HIttWv24kTK8lWqmUgh69qOJhpo4wYgI5qlCXLthYDRmh7m7kd5 3uKcPVcPadke3BcJOvfZExN3cuEBAr1inNLDmIud/WUNdyPH0uVMUQG/7e5gvzwsRlHN OlMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=GsTG8lALSXFkkbPi8ZceiT5v9rNJDXjkmFjyPfdKasA=; b=YXa+JgrGJuaoxDb6fO9/5vbg0E6Yy2OuOwx3EfMEtUDbq2TvOMfQi5Nz9MgZYg7GJO aaDnIbdSqwQRWvxLOP5XwyyTlxwNEYEkoCgly5d7SHtXNENUEzOGlDdb51OKAn9XnC2l Z73zIbZAZTykzHwhbAY7GpD0c4qT9FnUQBbnC/jDlJkzmo/qHOvS7QrqNDzcR33a4RHD Ir1v/Ytz39GTvmClJAHPxHSRPBHx+2sU82N/gXXHkQTkeGgBdGhc9vmHN+CmTu4XYIRD JshdHq5Z0Yw8Xnl9vuO+pAy4q0JUOfLqYQvbQ7yDA5WKFFgIKvj9Zao1mOlBOTGJo5vQ v/6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w68-v6si7881900pfw.308.2018.09.07.02.58.44; Fri, 07 Sep 2018 02:59:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728333AbeIGOE2 (ORCPT + 99 others); Fri, 7 Sep 2018 10:04:28 -0400 Received: from mga09.intel.com ([134.134.136.24]:44890 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728297AbeIGOE2 (ORCPT ); Fri, 7 Sep 2018 10:04:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2018 02:24:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,341,1531810800"; d="scan'208";a="71327138" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 07 Sep 2018 02:24:25 -0700 Received: from dazhang1-ssd.sh.intel.com (unknown [10.239.48.163]) by linux.intel.com (Postfix) with ESMTP id 708385802B3; Fri, 7 Sep 2018 02:24:22 -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 V5 1/4] kvm: remove redundant reserved page check Date: Sat, 8 Sep 2018 02:03:28 +0800 Message-Id: <26f79872e78cc643937059003763b5cfc1333167.1536342881.git.yi.z.zhang@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4