Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp624629ybl; Wed, 11 Dec 2019 05:06:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzBlkOzTYZ71Sc0osmn/5Odv3VkhJGIVfwGfbub0MFE50zJDlVraoGY7LgB+b8z2MYmp/Uv X-Received: by 2002:a05:6830:4a4:: with SMTP id l4mr2231302otd.91.1576069596668; Wed, 11 Dec 2019 05:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576069596; cv=none; d=google.com; s=arc-20160816; b=FaiQbyhzzkCg52oQvGv5xvQrgBHnknHvcy79ct0Yas57sBKeEOk9US4FnrnrYQqDK0 YQtXerVU2X9gE5M0BzgT7BO5dJlNyPxUEmIhtlNsEWQmGmV8HTpN89OwI5wcieU1j8lZ cD+VByy8ypO5xkHHYFF0l1Coyys4VxTTD2e7/jSaivqKZaGSXXf1yBqLu3QqNnaxywxy 7VtIj4uAatJsn8Oht6Z4RjSsG3SaxmtrSLewm8594ZJrsYo0n8zZB18jVkYUmH4SFnbi DUx5oiBX7/XxxdEjKS8rN3+8VtNetdHIYCfbn0ND3yQMdtOBeFSR35XpM76Q8fi9WVvo A9Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:in-reply-to:mime-version:references :message-id:subject:cc:to:from:date:dkim-signature; bh=668P4/OaTFkh0OL4KrzWbTMYtWCJ7hnKwvkYl6vOypI=; b=NBtzH3bGuRSgTVSBvf4ul3kFul1KGGaMKs5j8WZ0xR1vqK+4es0rmqVdT/tbowev6i Pqk3HcsE/FYVs5p0uztcMbHhese9DnvgJkyYdSXpu6ySEn+c1YOS4wkLtg1woUFgoAmp OIFxGkVwD8xddlxoahGXxJGNqjrszaTpIYAuu0ohWFQ3s1OBZPIaqQQYrHIGzdjQzhTC UUv1+/NHVbKx/Siw/D/C9CdxNxv5w2Wc+CC8+iKKSb8brNRwdIuzlEQl9pdEbLpR1LHg ZAS6zvi/4U9Uaixh3b8m1bcH7yDdQ3gXiz0by5MaHo+ozO/O7DAqjMR9cFk9/0ns3H9p xujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Nk+N/paw"; 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 h138si1013311oib.6.2019.12.11.05.06.22; Wed, 11 Dec 2019 05:06:36 -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="Nk+N/paw"; 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 S1729406AbfLKNEr (ORCPT + 99 others); Wed, 11 Dec 2019 08:04:47 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:25833 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729132AbfLKNEr (ORCPT ); Wed, 11 Dec 2019 08:04:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576069486; 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=668P4/OaTFkh0OL4KrzWbTMYtWCJ7hnKwvkYl6vOypI=; b=Nk+N/pawziQpWUkhC7J70w9e0IpB2Kl4yyZh+HEcKmvIk87BnsvvpOObAk2+LEguhWF1Q1 s3ZQwLH0f1ndYYkp4ClcU9mjs95VBxLneVKOr22OsvQwjSPuYlJJpekD2llEbs9j9F3q1g LFS+AmzrNDrq3g1DvtMmxzShaxzHO20= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-qvCX6NzeMlGg_bmoYvuLHA-1; Wed, 11 Dec 2019 08:04:42 -0500 Received: by mail-qk1-f197.google.com with SMTP id s9so14459953qkg.21 for ; Wed, 11 Dec 2019 05:04:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ARBDs3VLIa5a0RMtKyWzB3pZRG0sJsUGt9fBfh6q/08=; b=YAMY7tGJxO9jB3Czf93Ca+dIFA5XaTbxFOorBuAPsh/2sb2WZTbE5xWSNjAvyegbCL z1UuHADxhLGVe3tzLYOHs9eRfbBZ/cMIvN6FeN/9ZdthO9lndcexvLiDXWujMKi0pLw2 DVFe1EKKIIuZeRq/bItb3FnDjLrQvAcHK3lPwleMMagrqtRYDD526i6EV1kxPF5jjS1D nT6Zjqfbdqsg40by18foIpD92A8F63YzEMKUgeIKEJATQ0EfzQtJ4i4dJgioN0ZlD+DK KrFH3MCd9f+ZsQ4TzZHtVTiC/GUQIqYuhN6nLrX8AdZ6Uh6TorFKnSsF9GW/3qHa0qs8 Dq7w== X-Gm-Message-State: APjAAAVxl2KWAT5V5k+DBOuzm6dasIalMCao94Ley++BFp+aizkKmECp tliZZjwO/PIqOrZCFssp4WrIFkFE9wcI090XL4fw8KgJ5xDt8+7VScEUN4VSTrP/i4ZoD4p1NtX VE7wn7nL+SEgvqn9vkUfifJpZ X-Received: by 2002:ac8:7491:: with SMTP id v17mr2569503qtq.154.1576069482495; Wed, 11 Dec 2019 05:04:42 -0800 (PST) X-Received: by 2002:ac8:7491:: with SMTP id v17mr2569484qtq.154.1576069482284; Wed, 11 Dec 2019 05:04:42 -0800 (PST) Received: from redhat.com (bzq-79-181-48-215.red.bezeqint.net. [79.181.48.215]) by smtp.gmail.com with ESMTPSA id g62sm647370qkd.25.2019.12.11.05.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 05:04:41 -0800 (PST) Date: Wed, 11 Dec 2019 08:04:36 -0500 From: "Michael S. Tsirkin" To: Paolo Bonzini Cc: Peter Xu , Jason Wang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , "Dr . David Alan Gilbert" , Vitaly Kuznetsov Subject: Re: [PATCH RFC 04/15] KVM: Implement ring-based dirty memory tracking Message-ID: <20191211075413-mutt-send-email-mst@kernel.org> 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> <1597a424-9f62-824b-5308-c9622127d658@redhat.com> MIME-Version: 1.0 In-Reply-To: <1597a424-9f62-824b-5308-c9622127d658@redhat.com> X-MC-Unique: qvCX6NzeMlGg_bmoYvuLHA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 11, 2019 at 10:05:28AM +0100, Paolo Bonzini wrote: > 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). > >=20 > > I guess you don't do polling/ event suppression and other tricks that > > virtio came up with for speed then? I looked at the code finally, there's actually available, and fetched is exactly like used. Not saying existing code is a great fit for you as you have an extra slot parameter to pass and it's reversed as compared to vhost, with kernel being the driver and userspace the device (even though vringh might fit, yet needs to be updated to support packed rings though). But sticking to an existing format is a good idea IMHO, or if not I think it's not a bad idea to add some justification. > 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. >=20 > Paolo OK don't use that then. --=20 MST