lkml.org 
[lkml]   [2011]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 16/19] KVM: MMU: lockless walking shadow page table
On 07/07/2011 02:08 AM, Marcelo Tosatti wrote:

>> +static void free_pages_rcu(struct rcu_head *head)
>> +{
>> + struct kvm_mmu_page *next, *sp;
>> +
>> + sp = container_of(head, struct kvm_mmu_page, rcu);
>> + while (sp) {
>> + if (!list_empty(&sp->link))
>> + next = list_first_entry(&sp->link,
>> + struct kvm_mmu_page, link);
>> + else
>> + next = NULL;
>> + kvm_mmu_free_page(sp);
>> + sp = next;
>> + }
>> +}
>
> There is no need for this while loop.
>

The while loop is needed, since many shadow pages can be freed together in
the rcu context, on commit_zap_page path, we only remove the list head, and
the shadow page is still listed.





\
 
 \ /
  Last update: 2011-07-06 21:27    [W:0.070 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site