[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <577e68a6-22ad-d8a2-81f3-1f71b02d0a18@redhat.com>
Date: Wed, 18 Dec 2019 17:41:59 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Peter Xu <peterx@...hat.com>
Cc: Christophe de Dinechin <dinechin@...hat.com>,
Christophe de Dinechin <christophe.de.dinechin@...il.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Sean Christopherson <sean.j.christopherson@...el.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
David Hildenbrand <david@...hat.com>,
Eric Auger <eric.auger@...hat.com>,
Cornelia Huck <cohuck@...hat.com>
Subject: Re: [PATCH RFC 04/15] KVM: Implement ring-based dirty memory tracking
On 18/12/19 17:32, Peter Xu wrote:
>> With PML it is. Without PML, however, it would be much slower to
>> synchronize the dirty bitmap from KVM to userspace (one atomic operation
>> per page instead of one per 64 pages) and even impossible to have the
>> dirty ring.
>
> Indeed, however I think it'll be faster for hardware to mark page as
> dirty. So could it be a tradeoff on whether we want the "collection"
> to be faster or "marking page dirty" to be faster? IMHO "marking page
> dirty" could be even more important sometimes because that affects
> guest responsiveness (blocks vcpu execution), while the collection
> procedure can happen in parrallel with that.
The problem is that the marking page dirty will be many many times
slower, because you don't have this
if (!dirty_bitmap[i])
continue;
and instead you have to scan the whole of the page tables even if a
handful of bits are set (reading 4K of memory for every 2M of guest
RAM). This can be quite bad for the TLB too. It is certainly possible
that it turns out to be faster but I would be quite surprised and, with
PML, that is more or less moot.
Thanks,
Paolo
Powered by blists - more mailing lists