Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5395329ybl; Tue, 10 Dec 2019 05:26:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzeRXYuxcsSYwWD4EXHBw2s88CNm+Ij3Dw2PZMAxLSR2F4H+5aTHB0AGCQRMQn726Fc8cts X-Received: by 2002:aca:3a06:: with SMTP id h6mr3862778oia.137.1575984416870; Tue, 10 Dec 2019 05:26:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575984416; cv=none; d=google.com; s=arc-20160816; b=dmuv3R9HsSKzfjpnTGLwNQ6AXXcwpRX1Xdm0shy9/agsRLPnSYczj4KDFSK1YEBKci YlNG9RKJrmqQNvE8DoUu82bxqrowANxN0TFKfBi8tGBjX4bQE8KJzm/XVPxaFGK1VAYd guWcY4zZMQJl+I7wlNOyhiGVB7JDp+qkpZ+zIIbXF3dufzt0qU6XBbGVty0WYGI4nlJk GoQqHrEn6ZjUegvoHydxvA2S1sfLvpaqaMUXcsVJ+Le8MrmyBTUAABMYmDyWKqCQkviZ Zb3VUvXuGCp/2i1hZqWTXmaZby90YBCRQ1l6IQfY/8CGyQLy9EAh3o3u9J2tFzmKaWG0 oq5g== 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=n00JJ/T4yzKQXwRZ4QxpKz4nx3mh99h11BJMbwluGO0=; b=vuhcIrAL0Qd0EPK7G6P0FLbC8ESNysRJx5rNBBxwt7Byk45D4iw/l6NTpT1b0SEvR2 Lgao7ipvdzPQQGAByJhxCPsbAneNKdecslZA2NgzhpjY7qDiGO63bmuOdmzz93OmcG7B c73fZZ+zxqXtbkHQEfH6XxE1Zc5u2KYuqurD4ziPkksVWI4BOzTZv4YWj+0446loobYl SyhbHuTB2ZVPcQdATLusOmvGf4bPu9ntD9Js6+Pvt+L3+L4GaDsFXa6siS8IgYXofCNQ Bf/Fk2kTlPK2gqW2tMSXou6uXW2CpweXTnuV7q6MSouXgskTmGhnuTfnq3nauxTg5bhK HZag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WKzO+k8f; 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 z14si1880213oth.15.2019.12.10.05.26.43; Tue, 10 Dec 2019 05:26:56 -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=WKzO+k8f; 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 S1727629AbfLJNZv (ORCPT + 99 others); Tue, 10 Dec 2019 08:25:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50199 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727508AbfLJNZu (ORCPT ); Tue, 10 Dec 2019 08:25:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575984350; 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=n00JJ/T4yzKQXwRZ4QxpKz4nx3mh99h11BJMbwluGO0=; b=WKzO+k8fAgJjTImIhOEqXoFLxbU8xB6A58C/4GaKRum91cc0KMpx23aCm3eT0efCTd+mQA MMy08h2QGLdhYatH01VWhAFY9Vq4Boiv0QLDKFRxCS1zCHmaFThfwEl8bdIuTobBZKikIw mMV5zYdpLT42Ary0MIk72FEtXdphcy4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-WspzY52qNCCFFyQFYSvi5A-1; Tue, 10 Dec 2019 08:25:48 -0500 Received: by mail-wm1-f71.google.com with SMTP id 7so592004wmf.9 for ; Tue, 10 Dec 2019 05:25:48 -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:content-transfer-encoding :in-reply-to; bh=h/LUwbgV6TmsnuImnzKLy4kXaRWB507qnk8lk81yvpI=; b=lTjmV/6G0wd9jHEvBv4w1VHxJ2cysxpu01IXoAQk0n3xcglw4rmLJEZBZjMlEJNaPN gID/F1WDgFpgBGwIP0LOC33I80c/hvO4fJQ4UdwmBW2jWAxA3+mT6IIB9ZeBWgo9uYSr nuZrzmgtK+azAqDUW4bkWb5x6JNiD1bNvMJ3TVfeTef3SvtRzTFBIglZq/sw92bp/FiR +xf0KjsxuHFJNwoZzkA5eoi8czEPLrC9PFKsLc1R5Fc2z23DvqP8bbUbvgyZ4tABixIS DxrnDGaYsQ3hEVDCaH+9Xt9ARMx5DFP7JSKDKbdzAfvG3/6M3R3/2k87iV/nCBlWZuv7 KAJw== X-Gm-Message-State: APjAAAXgnE9NCLPX9p0sZZYmu5cZW0DbQ69t6gk8tspvpRvPkwghi47y NhKi+yRX2DnTlMOK3U/olCuyK7rFd6sIFXQzSlqF8GnjxJX6hVz0I4bzsBUU4GEYNqdCBFaZx05 6kF4/g0rG6Y+/34C4qiSufDf2 X-Received: by 2002:adf:b602:: with SMTP id f2mr3125155wre.99.1575984347509; Tue, 10 Dec 2019 05:25:47 -0800 (PST) X-Received: by 2002:adf:b602:: with SMTP id f2mr3125139wre.99.1575984347323; Tue, 10 Dec 2019 05:25:47 -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 w17sm3212357wrt.89.2019.12.10.05.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 05:25:46 -0800 (PST) Date: Tue, 10 Dec 2019 08:25:43 -0500 From: "Michael S. Tsirkin" To: Paolo Bonzini Cc: Jason Wang , Peter Xu , 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: <20191210081958-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> MIME-Version: 1.0 In-Reply-To: X-MC-Unique: WspzY52qNCCFFyQFYSvi5A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=iso-8859-1 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 04, 2019 at 12:04:53PM +0100, Paolo Bonzini wrote: > On 04/12/19 11:38, Jason Wang wrote: > >> > >> +=A0=A0=A0 entry =3D &ring->dirty_gfns[ring->dirty_index & (ring->size= - 1)]; > >> +=A0=A0=A0 entry->slot =3D slot; > >> +=A0=A0=A0 entry->offset =3D offset; > >=20 > >=20 > > Haven't gone through the whole series, sorry if it was a silly question > > but I wonder things like this will suffer from similar issue on > > virtually tagged archs as mentioned in [1]. >=20 > 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? If you did and it's not a good fit, this is something good to mention in the commit log. I also wonder about performance numbers - any data here? > > Is this better to allocate the ring from userspace and set to KVM > > instead? Then we can use copy_to/from_user() friends (a little bit slow > > on recent CPUs). >=20 > Yeah, I don't think that would be better than mmap. >=20 > Paolo >=20 >=20 > > [1] https://lkml.org/lkml/2019/4/9/5