lkml.org 
[lkml]   [2010]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] KVM: MMU: split the operations of kvm_mmu_zap_page()


Avi Kivity wrote:

>
> It would be better to rewrite kvm_mmu_zap_page() in terms of
> prepare/commit in the patch so we don't have two copies of the same
> thing (also easier to review).

OK, i'll do it in the next version.

>
>
>
>
>>> This is a good idea, but belongs in a separate patch? We can use it to
>>> reclaim invalid pages before allocating new ones.
>>>
>>>
>> This patch is very simple and kvm_mmu_commit_zap_page() function
>> should depend on
>> kvm->arch.invalid_mmu_pages, so i think we on need separate this
>> patch, your opinion? :-)
>>
>>
>
> How about passing the list as a parameter to prepare() and commit()? If
> the lifetime of the list is just prepare/commit, it shouldn't be a global.
>

Does below example code show your meaning correctly?

+ struct list_head free_list = LIST_HEAD_INIT(&free_list);

hlist_for_each_entry_safe(sp, node, nn, bucket, hash_link) {
if (sp->gfn == gfn && !sp->role.direct
&& !sp->role.invalid) {
pgprintk("%s: zap %lx %x\n",
__func__, gfn, sp->role.word);
+ kvm_mmu_prepare_zap_page(kvm, sp, &free_list);
}
}
+ kvm_mmu_commit_zap_page(kvm, &free_list);


Thanks,
Xiao




\
 
 \ /
  Last update: 2010-06-01 04:35    [W:0.548 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site