Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp268853imm; Tue, 21 Aug 2018 19:19:02 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw7G8IAavxWN6umcfAleG4wDbCdLlqcbUw6zSQ7MCsQ4US8mcvGCntVARvkX/tkxZFAzMxu X-Received: by 2002:a17:902:5858:: with SMTP id f24-v6mr5903229plj.321.1534904342036; Tue, 21 Aug 2018 19:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534904342; cv=none; d=google.com; s=arc-20160816; b=ZAom6p3/kI7oE3m7nupBaFf8rEVxVh0UUyxntFKfLyZDCCpxL04mPEWGuH5d8BJz0S TpFrnWA2t+trqcpzzDIQKGA+cajekthSo1amYNNLEGRXFxNcR6T3oiX80zLNrg4aC8ww c5qi28RpRE9UUEXy9cP/SGJJnZJgHFHHETCA9smS5d1kkFLO7CqPm/m/QBKmvNCHJTb/ reYVkhqjlOoc+P4+IY0UeDO2g9+sSJRbFZP2t9wCXks3+M6wJmUFOzklKsN0Xg6SqZcF aPD5RYCutZ8hnx02pcR++5CtLxOHXj0wMBlwKSh397yxqtNDYtg/cryQzazNCpiJL+mM gHeg== 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:arc-authentication-results; bh=GsTG8lALSXFkkbPi8ZceiT5v9rNJDXjkmFjyPfdKasA=; b=vPf+dkaW1F7MISmveE/1OCHK+ujJ1HzbCjwPoYCjnWjvY6GOtTGJkltFOhq9kchJZk KzE5g33TjGntvYfqBv31p13uzikMsnw+So8Cdl6aLLXQuGq2p6jof0bzJQralvXpqO5W m6/NPqv/wbLrpCa2g53j/zwqQ3h0BbV8UhCAc6ZtMLE3wGyCdw54JgUZBrkuY+zxf90j twHg25LdeMcYyyy57h3rsP5xtCtrUI7avLn9eaB5uPI1SvMtBxeViUW+FOoufF429yD+ TVsnSDLrefOaf1CBOJ5YT8x/Ixofa55fAU97HIRB2i4jAJ8RiRI+F4AJMLZ/Y3f8rkiY K7ww== 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 u3-v6si426719plb.401.2018.08.21.19.18.47; Tue, 21 Aug 2018 19:19:02 -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 S1727636AbeHVFj1 (ORCPT + 99 others); Wed, 22 Aug 2018 01:39:27 -0400 Received: from mga04.intel.com ([192.55.52.120]:55543 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbeHVFj1 (ORCPT ); Wed, 22 Aug 2018 01:39:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.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: 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