From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76668C433ED for ; Fri, 16 Apr 2021 08:25:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5988761166 for ; Fri, 16 Apr 2021 08:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236787AbhDPIZs (ORCPT ); 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: kvm@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