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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 5794EC2D0C6 for ; Wed, 11 Dec 2019 09:05:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E158205C9 for ; Wed, 11 Dec 2019 09:05:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UoeO61fd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728372AbfLKJFf (ORCPT ); Wed, 11 Dec 2019 04:05:35 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:29561 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725973AbfLKJFe (ORCPT ); Wed, 11 Dec 2019 04:05:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576055133; 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=PenXlg+BC3zbnqNl3XULuIWWyu7R9w15XW00KbpnuWU=; b=UoeO61fdvoqPK+NfieeiO8B2OsRV+JH5SoBKeBXg6eF/pkYTxCmGgLPCnAqAoYeiwXbwIV n+pmx1Tl68JUG2MR2DH19a3qfjaEKkisEfPhRhEvZ50eNtuCdnTWPmJkQetCOvmRkX2rNR d51C5sl3eL9sNz/6w6PIP5UsmaJ6knA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-396-v_vkADSEPJCXfLIlpawvCg-1; Wed, 11 Dec 2019 04:05:32 -0500 Received: by mail-wm1-f69.google.com with SMTP id t4so876188wmf.2 for ; Wed, 11 Dec 2019 01:05:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PenXlg+BC3zbnqNl3XULuIWWyu7R9w15XW00KbpnuWU=; b=F+uVz2VOzTO6JjMJwUCwWtAmUqAmcf62nf2j2b13M6K5d84tcL14vkhb3rDfyXQkm3 YzAc8lWToJZcGyP4LF2lW8opIkX2FRXaJhRaqRKyhiVtoe6Aq0YUNGU2YmMgMbFTf6gY pH+YCXytDP27BHVY5uwNVczQosxAI3SWq8CpkesksNiHvvw6AzeKG31ZjpjR4Qc+6IMX PHAs6k2pG0UcRP7l/uRXN8uo+PZuwHSelP0dvaB1Zt4TqlEc+SVgwvYO6XfB5Ibw9usW /o92t98iFVx5aPqo0ysqQwnF2RKIq/lvHZ5biBkccO0bwFs15/fiIsJ326dVyl0VQBIH w1Lw== X-Gm-Message-State: APjAAAWqg4l+jvN444GRy6t4/5aJNIE26rMuRItRhCdkjRLhTpgxmugC DqIi14Icw1fEcFBl2/sfBzIpnG1rixJE4WrLof6bsrjvtFeo0kNaFX6TosRlZ2G5cRoiJ54rPTe tKzozFgKy+/LSwO7h48WFyNuF X-Received: by 2002:a1c:9e58:: with SMTP id h85mr2336500wme.77.1576055130956; Wed, 11 Dec 2019 01:05:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzJswQMpAiJ3AaINMEQKXGXjrGFZxuu0EXkQGiD96eH1Lvt/2POIUge3oCgHe+0Q+Koq339fA== X-Received: by 2002:a1c:9e58:: with SMTP id h85mr2336471wme.77.1576055130639; Wed, 11 Dec 2019 01:05:30 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:e9bb:92e9:fcc3:7ba9? ([2001:b07:6468:f312:e9bb:92e9:fcc3:7ba9]) by smtp.gmail.com with ESMTPSA id u18sm1479960wrt.26.2019.12.11.01.05.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Dec 2019 01:05:29 -0800 (PST) Subject: Re: [PATCH RFC 04/15] KVM: Implement ring-based dirty memory tracking To: "Michael S. Tsirkin" , Peter Xu Cc: Jason Wang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , "Dr . David Alan Gilbert" , Vitaly Kuznetsov References: <20191129213505.18472-1-peterx@redhat.com> <20191129213505.18472-5-peterx@redhat.com> <1355422f-ab62-9dc3-2b48-71a6e221786b@redhat.com> <20191210081958-mutt-send-email-mst@kernel.org> <8843d1c8-1c87-e789-9930-77e052bf72f9@redhat.com> <20191210160211.GE3352@xz-x1> <20191210164908-mutt-send-email-mst@kernel.org> From: Paolo Bonzini Message-ID: <1597a424-9f62-824b-5308-c9622127d658@redhat.com> Date: Wed, 11 Dec 2019 10:05:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191210164908-mutt-send-email-mst@kernel.org> Content-Language: en-US X-MC-Unique: v_vkADSEPJCXfLIlpawvCg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/19 22:53, Michael S. Tsirkin wrote: > On Tue, Dec 10, 2019 at 11:02:11AM -0500, Peter Xu wrote: >> On Tue, Dec 10, 2019 at 02:31:54PM +0100, Paolo Bonzini wrote: >>> On 10/12/19 14:25, Michael S. Tsirkin wrote: >>>>> There is no new infrastructure to track the dirty pages---it's just a >>>>> different way to pass them to userspace. >>>> Did you guys consider using one of the virtio ring formats? >>>> Maybe reusing vhost code? >>> >>> There are no used/available entries here, it's unidirectional >>> (kernel->user). >> >> Agreed. Vring could be an overkill IMHO (the whole dirty_ring.c is >> 100+ LOC only). > > I guess you don't do polling/ event suppression and other tricks that > virtio came up with for speed then? There are no interrupts either, so no need for event suppression. You have vmexits when the ring gets full (and that needs to be synchronous), but apart from that the migration thread will poll the rings once when it needs to send more pages. Paolo