Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp142920pxb; Fri, 16 Apr 2021 01:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9XaRPMiwHY1ybhLH0bzKlXfNXQ7YCl/W4bnEr6nty8b9G4LIioUKLfB8cOQO68yutVctC X-Received: by 2002:a17:902:ed87:b029:eb:a96:7892 with SMTP id e7-20020a170902ed87b02900eb0a967892mr8230803plj.47.1618562517636; Fri, 16 Apr 2021 01:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618562517; cv=none; d=google.com; s=arc-20160816; b=zLyQRCj5CiSLOWuFO0Ya1RPz0ZBP9Mc3VHb2ecpAHleX2A79qVT4/opJrrzNhjGh+6 +wqBkEPz2MpJKtjyYpxIgLlg6ew2HkApsyz7My5BKWXLan2rf8ut/8ik0kLHfgO3nQtC S5BvpcVtWMbK+p+Ry8t6MpJ8TsTa/H51mz3WFjH0rYKOA5SGEmAukGuAdg+7NcFjrs59 XYnxlmGeIEyI9mb6w5PVHKOZSMTzoMkVhRaxQAIwoAJKFBHrApHGfEjB2f+w4kqyj+DQ DFo5X2ZMEJsZaJArSsSamDdhWq+BFBICxf81C1f9cTsg/zXPlyk6wb9C6ZtGyFENUp2c carg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=yqVyCSncPipFYSl8tNLySWElaJzsgI56I8ARsQhQjpw=; b=fK66HeIGObr0LTxHAjs9+hzfPnbv86l5v/kEkD0SABrT4srdj5Ct9CWxtBFhrrLJOz nSOhHqogcMUWiICRN2np7ZVXIDBDpCan/oAu+ApjbgltmawjWGD3cNdbjDfoCdQrzOoK MWSeDUChIqOyROq8OGced4p6cIBI9VepBiDeKa9cRG7ZRfW6ztm5JUVgVAH3Ag6Lhslf 7qHvnFxLhX/0u7W2JaVmIFy0LdYo2iAPMVabcJ4oznTT/jQzFDSdrkf6yWm21Ld63rTH AOxBHHn5ZhLl2bdIcujPbklh6xqMXu7dXRk2AD4mGhZ35+ZEtvd8gP3tofiHiVjVlMll INRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si6163692plm.65.2021.04.16.01.41.44; Fri, 16 Apr 2021 01:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238397AbhDPIZs (ORCPT + 99 others); Fri, 16 Apr 2021 04:25:48 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:17364 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbhDPIZr (ORCPT ); Fri, 16 Apr 2021 04:25:47 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FM8Nv077CzlYCq; Fri, 16 Apr 2021 16:23:27 +0800 (CST) Received: from DESKTOP-5IS4806.china.huawei.com (10.174.187.224) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Fri, 16 Apr 2021 16:25:13 +0800 From: Keqian Zhu To: , , Paolo Bonzini , Sean Christopherson , Ben Gardon CC: Subject: [RFC PATCH v2 0/2] KVM: x86: Enable dirty logging lazily for huge pages Date: Fri, 16 Apr 2021 16:25:09 +0800 Message-ID: <20210416082511.2856-1-zhukeqian1@huawei.com> X-Mailer: git-send-email 2.8.4.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.224] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently during start dirty logging, if we're with init-all-set, we write protect huge pages and leave normal pages untouched, for that we can enable dirty logging for these pages lazily. Actually enable dirty logging lazily for huge pages is feasible too, which not only reduces the time of start dirty logging, also greatly reduces side-effect on guest when there is high dirty rate. Thanks, Keqian Keqian Zhu (2): KVM: x86: Support write protect gfn with min_level KVM: x86: Not wr-protect huge page with init_all_set dirty log arch/x86/kvm/mmu/mmu.c | 57 ++++++++++++++++++++++++++++----- arch/x86/kvm/mmu/mmu_internal.h | 3 +- arch/x86/kvm/mmu/page_track.c | 2 +- arch/x86/kvm/mmu/tdp_mmu.c | 16 ++++++--- arch/x86/kvm/mmu/tdp_mmu.h | 3 +- arch/x86/kvm/x86.c | 37 ++++++--------------- 6 files changed, 76 insertions(+), 42 deletions(-) -- 2.23.0