Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1802996ybl; Fri, 13 Dec 2019 23:58:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyMXw8CWHVMTmuJQF0jRb5sZ/Gd+VaD1ogO6c4hdnJ/9gBULwq+qwptI36PP+rrvmLYI1fH X-Received: by 2002:a05:6830:1615:: with SMTP id g21mr20141200otr.49.1576310325203; Fri, 13 Dec 2019 23:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576310325; cv=none; d=google.com; s=arc-20160816; b=vSbGpyBEWaECMATHmDMDmzU+TFKDomKSPZNUlEY+FwEO0cVMXxb57LdIcee67dC7Np Hz0yZk+algS74DJdV6P6v18P83krhXQ2+uNSkOgtA30AaQLut2mEXcaHsGtVpOquIyWe 0ktkzbyfvbgyjXpXHba9YYMTnVHxYAmLN+EhhwVx+t9EcnTXlYJyzDPOHlewXG4ZI0L3 0yz+4BrdrGeDJLDfjwHngNE4KYPT5OkAA1oS+cJX8ihmI14Zrzh4hYHt6RvP4mh7pEKI YBT8n9s0Xk6S4EVDY/eOU+Uh/GFPXf0ylji+ajDGuPEWlmFt1DD3oQsMoRjwdLyTcRzJ nUxg== 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=x9Bb0Zg6nYlZHmt3Jv+uUkpX8UNR1qjNTKqsdhP1H0A=; b=B/rMuADw8Q5/tw9s7PpPMKbtTDkfU+3QwUbdvO56Xv588uzHWyiE2eLDspPaidpYFp nXlWzTBx79IK7bx/Z2q+QmBZ1lDODG4sfu/LcOwgfGCH/2hMQOI7TaWj3LdnZYxcunvJ aHRS/dCcJny4HxGTNusYbXY1H/cQDby96pu0ur1NThLabc/fGxTIpEcByMrAOFM4/UB6 Tnz4z7EdtPu+hsCEMx6TX/I+uq/QmnAihkwL5n3gbIAws8b/VsBlQ9ayiRy0V4HZr4qD iZN0Ql7a+n5S8FSZAeGDkqpLzZ2K0Piw7cUdrJE/+0UPGMq6M2Fvaedw49PriYG6+vl1 TKwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bDaus4Fg; 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 v92si7494253otb.140.2019.12.13.23.58.33; Fri, 13 Dec 2019 23:58:45 -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=bDaus4Fg; 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 S1726052AbfLNH5c (ORCPT + 99 others); Sat, 14 Dec 2019 02:57:32 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:55899 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbfLNH5b (ORCPT ); Sat, 14 Dec 2019 02:57:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576310250; 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=x9Bb0Zg6nYlZHmt3Jv+uUkpX8UNR1qjNTKqsdhP1H0A=; b=bDaus4FgtqVCH4gqVuupyzHz+YILhoU/NNhWpZPcl8uwWDfQ/mCMYoqQUlIOwuVJRo6Tkm ri70d5DEWmW0csVscdnzwjExZrMM6OYf4z48lbeeEchnbFrJ2/PzIoS5cPNrxdby+liEXT VZp9jKrxGAK1EKKGG+bT5OhN31rNAR8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-PNElSHXPMPiIVAmGfcHcmw-1; Sat, 14 Dec 2019 02:57:28 -0500 X-MC-Unique: PNElSHXPMPiIVAmGfcHcmw-1 Received: by mail-wr1-f70.google.com with SMTP id v17so665579wrm.17 for ; Fri, 13 Dec 2019 23:57:28 -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=x9Bb0Zg6nYlZHmt3Jv+uUkpX8UNR1qjNTKqsdhP1H0A=; b=aTQ1/9WIx7vIBljH3dHUnjruVmMqIqldnvQleRK4KpJPJgoP1TzBB5Wbr4A6hLbzpm p0hbXZTnrArlwWnFvljgjdwaSnlbJHMhVW9A92/doSTopIRYARtv+NXEKyRXYSCSwc/q 5PtXGVLYb/Lycj87RwkxFxPvihJFGn1JaO+zZophzYE432ObM/j+WFuYO98+J3NoNL9p Mvvb9i5/sOuReuy5r8wDRScv5IZC1Fiz5Z6AooPGwfS3+fSSEjKlkcjLmewsGFk+pKQk /PKVo9uZcfc7uaHrjtS0mHVG3/T2hgjSEwJmIWvcwrNWBc7F+Kje3g8ZLHl5/nwD9T42 d8hQ== X-Gm-Message-State: APjAAAXUzvxbRx/Jsjes6TLwLJysFVlU7ToJR81dG5V3nMC3yPNOpKwj L1YQNGeYrTTAAq+YVF51U1izg6ouPKeAwoEiFIb/yEPtrMq3wkJMNAZVL8DjHm2iaVD/F3lqnfK gAZOKgFaLtxEtZFhVBrLWtk5I X-Received: by 2002:a7b:c1d8:: with SMTP id a24mr18263336wmj.130.1576310247437; Fri, 13 Dec 2019 23:57:27 -0800 (PST) X-Received: by 2002:a7b:c1d8:: with SMTP id a24mr18263308wmj.130.1576310247108; Fri, 13 Dec 2019 23:57:27 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:cde8:2463:95a9:1d81? ([2001:b07:6468:f312:cde8:2463:95a9:1d81]) by smtp.gmail.com with ESMTPSA id n3sm13470462wmc.27.2019.12.13.23.57.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Dec 2019 23:57:26 -0800 (PST) Subject: Re: [PATCH RFC 04/15] KVM: Implement ring-based dirty memory tracking To: Peter Xu , Christophe de Dinechin Cc: 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> <20191213202324.GI16429@xz-x1> From: Paolo Bonzini Message-ID: Date: Sat, 14 Dec 2019 08:57:26 +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: <20191213202324.GI16429@xz-x1> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/19 21:23, Peter Xu wrote: >> What is the benefit of using u16 for that? That means with 4K pages, you >> can share at most 256M of dirty memory each time? That seems low to me, >> especially since it's sufficient to touch one byte in a page to dirty it. >> >> Actually, this is not consistent with the definition in the code ;-) >> So I'll assume it's actually u32. > Yes it's u32 now. Actually I believe at least Paolo would prefer u16 > more. :) It has to be u16, because it overlaps the padding of the first entry. Paolo > I think even u16 would be mostly enough (if you see, the maximum > allowed value currently is 64K entries only, not a big one). Again, > the thing is that the userspace should be collecting the dirty bits, > so the ring shouldn't reach full easily. Even if it does, we should > probably let it stop for a while as explained above. It'll be > inefficient only if we set it to a too-small value, imho. >