Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp280766ybl; Wed, 4 Dec 2019 02:41:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwFyzwE5t+eDr6sb0VvfiNBGn1jKqF/f5W2wDsSp4MYnaZxUvLvxJpq3t3HFgZrgAhOtYUl X-Received: by 2002:aca:75d7:: with SMTP id q206mr1984232oic.9.1575456064112; Wed, 04 Dec 2019 02:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575456064; cv=none; d=google.com; s=arc-20160816; b=dTfefiiZCqVqB3X7cR0WDhSFop/6pdNVN+wiuROmSbsqqL0s9g2Cpz+f8LnWMwkFNq VK0MS6/z9BQaQtGG34EYTap4dY4ghXSbh3L47QZTCFgO8GHNXzjokHdnlobHQ9vGyqXI KCAnxzNFj8AZuAhVsrt5s1AoIxGHnM4ZwvY3+FeIciBW6hKCq6US0mMqFxg2Eh67wQ0S WG3rgdWqb1XtGo2d8cuyVZ/6ExU+cKI6Gc7eRlQvpXmZX58psFApKL5FcMRSFgRwDmJz LjLz+hOsty1+K/BMBjeQcbtLpWVb6NNr/yOYbh+ZygI9yabwihRO8D9W2l94JC4tk1V1 /Wkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=YRNmBx2wsqK9xIWW91qWtVivmtgY9ipTfRTyxrXmrXQ=; b=NQUIIiG9Bz2L+Fh5Pywp8hyOVzSgr4qOiswDpLa0ogpwzbHrJ6Er6a7dOL0EGqsCeK 8dlR3tCaEGBeMwfKUIgEyiAXC0oHI2RR0DLpenBQMArGZgcxyr81qOUwriN8+UxgsArS n8djCFEbR519OVJs3TE/bbPfbKccIeGOGNmaG1eiq7+Pek4ElAjqX3tYVPtVxHmT5mmz H23UYqZ3FjwDWgHpXPQpHPp7tvH4tbvhuRCtgVrrsVQM3q99XyF2IJLmnTlw7AmvrQRI QT6ImjOLuY3ETe/e7W4KmIFQiugv9JQVwas5SXyvA7BdpOsjORIONlpjP6PshPQMdcHz 2xZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H1wc9iFB; 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=pass (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 16si3075297otn.228.2019.12.04.02.40.51; Wed, 04 Dec 2019 02:41:04 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H1wc9iFB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbfLDKkV (ORCPT + 99 others); Wed, 4 Dec 2019 05:40:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21953 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727445AbfLDKkU (ORCPT ); Wed, 4 Dec 2019 05:40:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575456019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YRNmBx2wsqK9xIWW91qWtVivmtgY9ipTfRTyxrXmrXQ=; b=H1wc9iFBDQZCik8Yxgr7/aF8fRvcysYMLOIjky913WJRBIbg2EQLlxDtw7V73P6G5xP9Wk G0L+C6bbDCAxoV6Ozi/YA+xO5jtp0cGt8QokbYt9kIa7h9V8pWoKforqmJW6azlS782Cu3 ke4YDO/gusBxjqXMYcWPJVV3opt3hPw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157--F5P7tqOPUahJOzke-L-NA-1; Wed, 04 Dec 2019 05:40:16 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A85A618A8C89; Wed, 4 Dec 2019 10:40:15 +0000 (UTC) Received: from [10.72.12.45] (ovpn-12-45.pek2.redhat.com [10.72.12.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BBBD177E4; Wed, 4 Dec 2019 10:39:59 +0000 (UTC) Subject: Re: [PATCH RFC 00/15] KVM: Dirty ring interface To: Peter Xu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Sean Christopherson , Paolo Bonzini , "Dr . David Alan Gilbert" , Vitaly Kuznetsov , "Michael S. Tsirkin" References: <20191129213505.18472-1-peterx@redhat.com> From: Jason Wang Message-ID: <776732ca-06c8-c529-0899-9d2ffacf7789@redhat.com> Date: Wed, 4 Dec 2019 18:39:48 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191129213505.18472-1-peterx@redhat.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: -F5P7tqOPUahJOzke-L-NA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/11/30 =E4=B8=8A=E5=8D=885:34, Peter Xu wrote: > Branch is here:https://github.com/xzpeter/linux/tree/kvm-dirty-ring > > Overview > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > This is a continued work from Lei Cao and Paolo > on the KVM dirty ring interface. To make it simple, I'll still start > with version 1 as RFC. > > The new dirty ring interface is another way to collect dirty pages for > the virtual machine, but it is different from the existing dirty > logging interface in a few ways, majorly: > > - Data format: The dirty data was in a ring format rather than a > bitmap format, so the size of data to sync for dirty logging does > not depend on the size of guest memory any more, but speed of > dirtying. Also, the dirty ring is per-vcpu (currently plus > another per-vm ring, so total ring number is N+1), while the dirty > bitmap is per-vm. > > - Data copy: The sync of dirty pages does not need data copy any more, > but instead the ring is shared between the userspace and kernel by > page sharings (mmap() on either the vm fd or vcpu fd) > > - Interface: Instead of using the old KVM_GET_DIRTY_LOG, > KVM_CLEAR_DIRTY_LOG interfaces, the new ring uses a new interface > called KVM_RESET_DIRTY_RINGS when we want to reset the collected > dirty pages to protected mode again (works like > KVM_CLEAR_DIRTY_LOG, but ring based) > > And more. Looks really interesting, I wonder if we can make this as a library then=20 we can reuse it for vhost. Thanks