qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 2/6] KVM: introduce dirty_pages into CPUState


From: Peter Xu
Subject: Re: [PATCH v1 2/6] KVM: introduce dirty_pages into CPUState
Date: Tue, 1 Jun 2021 21:26:24 -0400

On Wed, Jun 02, 2021 at 08:27:19AM +0800, Hyman Huang wrote:
> 在 2021/6/2 7:20, Peter Xu 写道:
> > On Tue, Jun 01, 2021 at 01:04:06AM +0800, huangy81@chinatelecom.cn wrote:
> > > diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
> > > index 044f668a6e..973c193501 100644
> > > --- a/include/hw/core/cpu.h
> > > +++ b/include/hw/core/cpu.h
> > > @@ -375,6 +375,8 @@ struct CPUState {
> > >       struct kvm_run *kvm_run;
> > >       struct kvm_dirty_gfn *kvm_dirty_gfns;
> > >       uint32_t kvm_fetch_index;
> > > +    uint64_t dirty_pages;
> > > +    bool stat_dirty_pages;
> > 
> > Shall we make this bool a global one?  As I don't think we'll be able to 
> > only
> > enable it on a subset of cpus?
> Yes, it's a reasonable advice, i'll apply this on the next version

Or even drop the bool and do the accounting unconditionally?  No need to do +1
for each pfn, but do it once before returning from kvm_dirty_ring_reap_one().

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]