public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] KVM MMU: make kvm_mmu_zap_page() return the number of zapped sp in total.
Date: Fri, 23 Apr 2010 11:49:43 +0800	[thread overview]
Message-ID: <4BD118D7.4040102@cn.fujitsu.com> (raw)
In-Reply-To: <4BD017CD.1090500@cn.fujitsu.com>



Gui Jianfeng wrote:
> Currently, in kvm_mmu_change_mmu_pages(kvm, page), "used_pages--" is  performed after calling
> kvm_mmu_zap_page() in spite of that whether "page" is actually reclaimed. Because root sp won't be 
> reclaimed by kvm_mmu_zap_page(). So making kvm_mmu_zap_page() return total number of reclaimed sp
> makes more sense. A new flag is put into kvm_mmu_zap_page() to indicate whether the top page is reclaimed.
> 

This bug only hurts kvm_mmu_change_mmu_pages() function, we'd better allow 'self_deleted' is
NULL, then we can pass NULL at other place.

> @@ -1571,7 +1584,8 @@ restart:
>  			pgprintk("%s: gfn %lx role %x\n", __func__, gfn,
>  				 sp->role.word);
>  			r = 1;
> -			if (kvm_mmu_zap_page(kvm, sp))
> +			ret = kvm_mmu_zap_page(kvm, sp, &self_deleted);
> +			if (ret > 1 || (ret == 1 && self_deleted == 0))
>  				goto restart;

Maybe we can keep kvm_mmu_zap_page() returns the number of zapped children,
and 'self_deleted' indicates whether self is zapped, then we no need modify
those function, just fix kvm_mmu_change_mmu_pages() that is if 'self_deleted == 1',
inc 'used_pages'

Xiao


  reply	other threads:[~2010-04-23  3:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22  9:33 [PATCH 1/3] KVM MMU: make kvm_mmu_zap_page() return the number of zapped sp in total Gui Jianfeng
2010-04-23  3:49 ` Xiao Guangrong [this message]
2010-04-23  5:03   ` Gui Jianfeng
2010-04-23  5:58     ` [PATCH 1/3 v2] " Gui Jianfeng
2010-04-26 17:36       ` Marcelo Tosatti
2010-05-03 13:38         ` Gui Jianfeng
2010-05-04 13:25           ` Marcelo Tosatti
2010-05-05  0:18             ` Gui Jianfeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD118D7.4040102@cn.fujitsu.com \
    --to=xiaoguangrong@cn.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox