Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1019927pxy; Wed, 28 Apr 2021 20:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUYAEONQa+OQp6LxoQlyioqSbE3DBPNdBFW7EIlykvMzHJ1AQHbhIn7fB78t3WnJauziKr X-Received: by 2002:a17:906:6488:: with SMTP id e8mr25425928ejm.367.1619667146151; Wed, 28 Apr 2021 20:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619667146; cv=none; d=google.com; s=arc-20160816; b=nryByIZ5kWIlWmlqgfwcnqOvDnidIROG7/iogSJtUQh3zxN6R0LlEt7G6piMbjUW98 blwCdgCps4Rlg2v1gzBbkfeLRcZrEeHGSt+p5xuA+0mIoCkuLnh3/WTKRP7sYn+yRTcp /KofxHrKkA2OkXK4Oq08PFZWwIcV0Sc9H4gLVfmhl+ewhhyNoA58VaLusvlmhwiq6Jei 0Jer7gPjEFf3AWXwTpW0jLAXMEpA9vW+381uI1k8fAyMUD5scsDTjcTo1ZEqQr+QhYtc Dtyy83jvLoPkFeKH9dI+6I5AyUTD8XuoBuAozB3x1iWPMxGeAjlEtloqNW0a4wvD/7xZ b/9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=alJr+HWXdGT3tE0FTB9RHDsup/q/TGsf8iChpTxQUdA=; b=UxbAuHPDv3uJjvwZgKUtF6pQBiBbtTxigfCq/b6kEQp5zIINckRy6+tDs7884q7FjM gWI34qLYfMSRUV2LmiOKStyKDHzXbh7cHbpkoC2kxZusZJnS9k8jHP0rc8KcRBXVbiqQ uE8ubouSLqP1lPs03FGfLKzKek7sk2MNu9y8My6WVKdDPrTGPiwyHpQ3i0t3cYEiCNBw t2usyvlgm8tNLsU9v9BlqbYvmzYHtc24OR9H9Sd4lGNZK5l9p6KzymPClUjYiS0xqyMe EmcX+fSuHiH8S2oKxcnZDeDofvahrktPfcthquRatmwVbTZzJQ7Re2KvSHGsDE2qoa4D Jo5Q== 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 f13si1681037edd.170.2021.04.28.20.32.00; Wed, 28 Apr 2021 20:32:26 -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 S233053AbhD2Dbr (ORCPT + 99 others); Wed, 28 Apr 2021 23:31:47 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:16166 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbhD2Dbq (ORCPT ); Wed, 28 Apr 2021 23:31:46 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FW1Cp45ChzpcHN; Thu, 29 Apr 2021 11:27:50 +0800 (CST) Received: from [10.174.187.224] (10.174.187.224) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 11:30:52 +0800 Subject: Re: [RFC PATCH v2 2/2] KVM: x86: Not wr-protect huge page with init_all_set dirty log To: Ben Gardon References: <20210416082511.2856-1-zhukeqian1@huawei.com> <20210416082511.2856-3-zhukeqian1@huawei.com> <49e6bf4f-0142-c9ea-a8c1-7cfe211c8d7b@huawei.com> <4f71baed-544b-81b2-dfa6-f04016966a5a@huawei.com> <60894846.1c69fb81.6e765.161bSMTPIN_ADDED_BROKEN@mx.google.com> CC: LKML , kvm , "Paolo Bonzini" , Sean Christopherson , "Wanghaibin (D)" From: Keqian Zhu Message-ID: Date: Thu, 29 Apr 2021 11:30:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.187.224] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ben, On 2021/4/29 0:22, Ben Gardon wrote: > On Wed, Apr 28, 2021 at 4:34 AM zhukeqian wrote: >> >> Oh, I have to correct myself. >> >> without this opt: >> first round dirtying: write fault and split large mapping >> second round: write fault >> >> with this opt: >> first round dirtying: no write fault >> second round: write fault and split large mapping >> >> the total test time is expected to be reduced. > > Oh yeah, good point. So we should really see the savings in the first > round dirty memory time. Good catch. > [...] >>> It would probably also serve us well to have some kind of "hot" subset >>> of memory for each vCPU, since some of the benefit of lazy large page >>> splitting depend on that access pattern. >>> >>> 3. Lockstep dirtying and dirty log collection >>> While this test is currently great for timing dirty logging >>> operations, it's not great for trickier analysis, especially >>> reductions to guest degradation. In order to measure that we'd need to >>> change the test to collect the dirty log as quickly as possible, >>> independent of what the guest is doing and then also record how much >>> "progress" the guest is able to make while all that is happening. >> Yes, make sense. >> >> Does the "dirty log collection" contains "dirty log clear"? As I understand, the dirty log >> collection is very fast, just some memory copy. But for "dirty log clear", we should modify mappings >> and perform TLBI, the time is much longer. > > Yeah, sorry. By dirty log collection I meant get + clear since the > test does both before it waits for the guest to dirty all memory > again. I see. > >> >>> >>> I'd be happy to help review any improvements to the test which you >>> feel like making. >> Thanks, Ben. emm... I feel very sorry that perhaps I don't have enough time to do this, many works are queued... >> On the other hand, I think the "Dirtying memory time" of first round can show us the optimization. > > No worries, I think this is a good patch either way. No need to block > on test improvements, from my perspective. OK, thanks. BRs, Keqian