Re: [RFC][PATCH 3/9] replace x86 kvm n_free_mmu_pages with n_used_mmu_pages

Dave Hansen
2010-06-16T15:42:28Z

On Wed, 2010-06-16 at 11:25 -0300, Marcelo Tosatti wrote:
> > - if (used_pages > kvm_nr_mmu_pages) {
> > - while (used_pages > kvm_nr_mmu_pages &&
> > + if (kvm->arch.n_used_mmu_pages > goal_nr_mmu_pages) {
> > + while (kvm->arch.n_used_mmu_pages > goal_nr_mmu_pages &&
> > !list_empty(&kvm->arch.active_mmu_pages)) {
> > struct kvm_mmu_page *page;
> >
> > page = container_of(kvm->arch.active_mmu_pages.prev,
> > struct kvm_mmu_page, link);
> > - used_pages -= kvm_mmu_zap_page(kvm, page);
> > - used_pages--;
> > + kvm->arch.n_used_mmu_pages -= kvm_mmu_zap_page(kvm, page);
> > + kvm->arch.n_used_mmu_pages--;
>
> kvm->arch.n_used_mmu_pages is deaccounted for in kvm_mmu_zap_page ->
> kvm_mmu_free_page
> already.

Ahh, I see that now. Thanks!

-- Dave