From patchwork Tue Jul 10 17:01:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yi" X-Patchwork-Id: 10516467 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 6CAE0600CA for ; Tue, 10 Jul 2018 08:23:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D42E28B68 for ; Tue, 10 Jul 2018 08:23:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5151428C71; Tue, 10 Jul 2018 08:23:22 +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=unavailable 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 B0F8D28B68 for ; Tue, 10 Jul 2018 08:23:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E21CB6B000E; Tue, 10 Jul 2018 04:23:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DCF0D6B0266; Tue, 10 Jul 2018 04:23:19 -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 C97A76B0269; Tue, 10 Jul 2018 04:23:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 888F16B000E for ; Tue, 10 Jul 2018 04:23:19 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id a20-v6so13530612pfi.1 for ; Tue, 10 Jul 2018 01:23:19 -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=XrrUdBPXE3xjAPAtV9zEB6GYpie7CzgBFU1OeXXPa+s=; b=ELHlSddWT3AH2sLV2P/nL2XWyTA6mto9KgRgZ28Fd+vY3APvMo8SeFWI4ypsfz9fY5 ZXhYL+YcRCoiF3IUHgbMuV0VWfjOjcDzaiQ58vs3aGI0lyzVi07T8PJyWEVzEHlo0mUZ e8sFm993jB2rS/QuqNNLp2X4Ib4c21f5DU9bo/QISfcXN7abbOwTPYMaB8fVf3AuYiY5 c/XFMivunsVUu8tcZe++DEDzwxF2rmkG1OXkHPBZLqEQ53fXCNXRVl52kgIgw1mg3gUq QzeGz7iPeM8tzBc2NifHOihbqSne+kWNil1EbtskrJDnWW2WVGHAwiOi49tNuE4brBjd 0oww== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 134.134.136.24 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: APt69E1QAx9VxthVuiK5XGITAGPQX9NlSbdlkLH4WfoGGwVxu5oGog1n IYMurGlPH9r52F7WAz8B46X6Ihq29pz0ArBMct0NuF6UQR4LXHHpnsg7gyWqrAsn6KlGrhtEtXa vJDQD4aCVomgwHr8PRZUQtncoRXCs3CnoxGHKhEto9xIDNdDeRqSt1QsoAOA9RPPlww== X-Received: by 2002:a63:7a0a:: with SMTP id v10-v6mr21546904pgc.444.1531210999255; Tue, 10 Jul 2018 01:23:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfgaBm77iu3uVNeATcEdT1EHhFnkOtM8lSOUslF0Ngj48BzZsUDwnOZlWtCLQfbaj8gWjo7 X-Received: by 2002:a63:7a0a:: with SMTP id v10-v6mr21546875pgc.444.1531210998673; Tue, 10 Jul 2018 01:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531210998; cv=none; d=google.com; s=arc-20160816; b=n14SRNeyH6+7tO11m7MmUao3Fq5N5QTy2voMpGH1bQMAn42ae6YzyXqur+vL6vzjA6 bORG+pBB8lEfwZ+tRecguYxL6R5wqPzImiYOjbtEOf4bOq2/F7mOHKqdimwxCODRX7Nb thMlEWdVLeZ/tu+zH0s/LsNnZOnY2Yu0QP1zr8W0d4vk0vp0iJhGmpIfSlKAPgbFcQYy ILQfTv78fMorLS/eH+/Hh4+eJ6lHG7lN8PhBvt39GEVJkA9scXjpcirx+2CJiNB4wqu3 S4Jo0T8uP0cVwussIQjKm/3vSsTVV3mcddx2LBi8io64rEkm7b3W7EqLF+7oBhA4ruV3 G6PQ== 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=XrrUdBPXE3xjAPAtV9zEB6GYpie7CzgBFU1OeXXPa+s=; b=LW8WU3Masd65Lu2bk1M3rfoz1FCpyhkaKCtV56umRRjwhVyOAROL1dgkZR2TAqgeDa COBYGOFCvn4kPgm6+yqbfPv8cN0Uhd02IpxfLGMCEFlkEotg1BdUM43varU9Sf9L35Nb ttXkmk7Jr0DWEMaq/Z2VC5VzYLy5APXwe9va5p4KukK26OcEQPdm1AT35AR5jl3MZ8uc F2z92WVkNjoPEPVW5ClD0s6fFCGNrzSGeM7ffGDnOi5e8+Avzt0mtJWprVoDJSEEK61N P2CGyFf4dB4T1GOsyGkBe7XRY8McHKM8rGULcXbvkpUSbQrEM80gh17+/8bWkuCmCCML xJKQ== 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 134.134.136.24 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 mga09.intel.com (mga09.intel.com. [134.134.136.24]) by mx.google.com with ESMTPS id o3-v6si15422114pgr.521.2018.07.10.01.23.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 01:23:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 134.134.136.24 as permitted sender) client-ip=134.134.136.24; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of yi.z.zhang@linux.intel.com designates 134.134.136.24 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 fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 01:23:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,333,1526367600"; d="scan'208";a="65648576" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP; 10 Jul 2018 01:23:17 -0700 Received: from dazhang1-ssd.sh.intel.com (unknown [10.239.48.78]) by linux.intel.com (Postfix) with ESMTP id EDE35580388; Tue, 10 Jul 2018 01:23:14 -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, jack@suse.cz, hch@lst.de, yu.c.zhang@intel.com Cc: linux-mm@kvack.org, rkrcmar@redhat.com, yi.z.zhang@intel.com, Zhang Yi Subject: [PATCH V2 1/4] kvm: remove redundant reserved page check Date: Wed, 11 Jul 2018 01:01:33 +0800 Message-Id: <3266d45a10db6d22e3978eacbe2683d43aec3100.1531241281.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.000000, 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 --- 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 c7b2e92..afb2e6e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1673,12 +1673,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);