From: Paolo Bonzini Date: Thu, 12 Aug 2021 16:08:11 +0000 Subject: Re: [PATCH v1] KVM: stats: Add VM stat for the cumulative number of dirtied pages Message-Id: <6296f7ac-bf99-2198-5a02-9d1ad721cbd3@redhat.com> List-Id: References: <20210811233744.1450962-1-jingzhangos@google.com> In-Reply-To: <20210811233744.1450962-1-jingzhangos@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jing Zhang , KVM , KVMPPC , Peter Shier , Oliver Upton , David Matlack , Ben Gardon , Peter Feiner On 12/08/21 01:37, Jing Zhang wrote: > A per VM stat dirty_pages is added to record the number of dirtied pages > in the life cycle of a VM. > The growth rate of this stat is a good indicator during the process of > live migrations. The exact number of dirty pages at the moment doesn't > matter. That's why we define dirty_pages as a cumulative counter instead > of an instantaneous one. Why not make it a per-CPU stat? mark_page_dirty_in_slot can use kvm_get_running_vcpu() and skip the logging in the rare case it's NULL. Paolo