kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Izik Eidus <ieidus@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: [patch 1/2] KVM: MMU: make __kvm_mmu_free_some_pages handle empty list
Date: Tue, 28 Jul 2009 22:05:45 +0300	[thread overview]
Message-ID: <4A6F4C09.5050006@redhat.com> (raw)
In-Reply-To: <20090728182726.079993317@amt.cnet>

Marcelo Tosatti wrote:
> From: Izik Eidus <ieidus@redhat.com>
>
> First check if the list is empty before attempting to look at list
> entries.
>
> Signed-off-by: Izik Eidus <ieidus@redhat.com>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: kvm/arch/x86/kvm/mmu.c
> ===================================================================
> --- kvm.orig/arch/x86/kvm/mmu.c
> +++ kvm/arch/x86/kvm/mmu.c
> @@ -2625,7 +2625,8 @@ EXPORT_SYMBOL_GPL(kvm_mmu_unprotect_page
>  
>  void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
>  {
> -	while (vcpu->kvm->arch.n_free_mmu_pages < KVM_REFILL_PAGES) {
> +	while (vcpu->kvm->arch.n_free_mmu_pages < KVM_REFILL_PAGES &&
> +	       !list_empty(&vcpu->kvm->arch.active_mmu_pages)) {
>  		struct kvm_mmu_page *sp;
>  
>  		sp = container_of(vcpu->kvm->arch.active_mmu_pages.prev,
>
>
>   
ack

  reply	other threads:[~2009-07-28 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 18:26 [patch 0/2] mmu fixes Marcelo Tosatti
2009-07-28 18:26 ` [patch 1/2] KVM: MMU: make __kvm_mmu_free_some_pages handle empty list Marcelo Tosatti
2009-07-28 19:05   ` Izik Eidus [this message]
2009-07-28 18:26 ` [patch 2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment Marcelo Tosatti
2009-07-28 19:05   ` Izik Eidus
2009-07-29 10:09 ` [patch 0/2] mmu fixes Avi Kivity

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=4A6F4C09.5050006@redhat.com \
    --to=ieidus@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).