public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	KVM list <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] KVM MMU: fix race in invlpg code
Date: Wed, 05 May 2010 15:52:14 +0300	[thread overview]
Message-ID: <4BE169FE.3020805@redhat.com> (raw)
In-Reply-To: <4BE1686D.9000902@cn.fujitsu.com>

On 05/05/2010 03:45 PM, Xiao Guangrong wrote:
>
> Avi Kivity wrote:
>
>    
>>>        spin_lock(&vcpu->kvm->mmu_lock);
>>> +    index = kvm_page_table_hashfn(gfn);
>>> +    bucket =&vcpu->kvm->arch.mmu_page_hash[index];
>>> +    hlist_for_each_entry_safe(s, node, tmp, bucket, hash_link)
>>> +        if (s == sp) {
>>> +            if (s->gfn == gfn&&   s->role.word == role.word)
>>> +                live = true;
>>> +            break;
>>> +        }
>>> +
>>> +    if (!live)
>>> +        goto unlock_exit;
>>> +
>>>
>>>        
>> Did you try the root_count method?  I think it's cleaner.
>>      
> Avi, Thanks for your idea.
>
> I have considered this method, but i'm not sure when it's the good time
> to real free this page, and i think we also need a way to synchronize the
> real free path and this path. Do you have any comment for it :-(
>    

Same as mmu_free_roots():

         --sp->root_count;
         if (!sp->root_count && sp->role.invalid) {
                 kvm_mmu_zap_page(vcpu->kvm, sp);
                 goto unlock_exit;
         }


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-05-05 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 12:19 [PATCH 1/2] KVM MMU: fix for forgot mark parent->unsync_children bit Xiao Guangrong
2010-05-05 12:21 ` [PATCH 2/2] KVM MMU: fix race in invlpg code Xiao Guangrong
2010-05-05 12:31   ` Avi Kivity
2010-05-05 12:45     ` Xiao Guangrong
2010-05-05 12:52       ` Avi Kivity [this message]
2010-05-05 12:30 ` [PATCH 1/2] KVM MMU: fix for forgot mark parent->unsync_children bit Avi Kivity
2010-05-05 12:35   ` Xiao Guangrong

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=4BE169FE.3020805@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiaoguangrong@cn.fujitsu.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