Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1807573imm; Thu, 9 Aug 2018 02:15:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzv7Wm4Rz2y2/VXDy5HkcBosv/MFplJS+yZTWXIkmC1HWwWA+Eo/jqPrcKIg++cqhNq3+NR X-Received: by 2002:a17:902:26:: with SMTP id 35-v6mr1320021pla.276.1533806107517; Thu, 09 Aug 2018 02:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533806107; cv=none; d=google.com; s=arc-20160816; b=lt5jpLcvilKbti/exSqGcSxfgccHGV2Z/EoWHIyHjOpFkWqe76uRUE04CFnuaYFt4e +Y8IZUfChW6q07WS/OoAZmH4SvLq0cJbHjLoOSdzRocXsrnTsI4kyruda1fwszFccgVM 7w+tLEfNfuwH2yuerkBZsOTENantFuv0x55mTvkjq4XXDLZtt9WuW8UpU0usx8r6FPui kT1eQcacAcc++QKK1pf0/jfxh/DY2jHlyFmewYF3K0iSfwnYlZS+QL6gmPvDg2uSIFqh tBnzMVhYSfNJBVeIy7f/UOAKNARmsqORF+YWmWal+6QP80j4eQNuE+HrIMPhq/ZiKXIm woGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:arc-authentication-results; bh=eEoSX+LHvgnng7QbejUHVZUX9Abo0jbyHcz3D1g4MXU=; b=brp528/qzn3boO7Xo9FEftxKudu3q7GYSfEw2UwekCVuBDdOBzKJPRlLSbsq5C8z4Z bk3gpXrZVCMqouGLYh08SlHLoTiaGE0Zh6qmNJ8BNhwuiDZroE8XR2tP6JnWfApiTm/p vcqPSvGLSO9b5g2oiBJSmiZpjH6+p5QyYO3lDK+4MGc+5siGCssaNKcRRrdfgKdcP32E QNQUsAwUnaVamcNqBx/bptncB4fc/OsfFrmOeF9Jypafr4uiUpK2aFO+fNjJG6pkvx6W 4HzA55puZBqg2Rh1N5NxDx1kq+/dmKrv0p05WFFtZH7WoGmDReaaagwqsSG9S2Kex/V/ yxyg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si5217706ply.251.2018.08.09.02.14.52; Thu, 09 Aug 2018 02:15:07 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbeHILhi (ORCPT + 99 others); Thu, 9 Aug 2018 07:37:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727371AbeHILhh (ORCPT ); Thu, 9 Aug 2018 07:37:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 452C912B20; Thu, 9 Aug 2018 09:13:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2922960A9E; Thu, 9 Aug 2018 09:13:42 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B548C4BB78; Thu, 9 Aug 2018 09:13:41 +0000 (UTC) Date: Thu, 9 Aug 2018 05:13:41 -0400 (EDT) From: Pankaj Gupta To: Zhang Yi Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, pbonzini@redhat.com, dan j williams , jack@suse.cz, hch@lst.de, yu c zhang , linux-mm@kvack.org, rkrcmar@redhat.com, yi z zhang Message-ID: <2036397219.889906.1533806021412.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: [PATCH V3 1/4] kvm: remove redundant reserved page check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.117.219, 10.4.195.28] Thread-Topic: remove redundant reserved page check Thread-Index: eU8Pao8KRqguboLqsHufj9uJmnci1w== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 09 Aug 2018 09:13:42 +0000 (UTC) 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 > --- > 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); Acked-by: Pankaj Gupta > > -- > 2.7.4 > >