Re: [PATCH v2] KVM: Avoid zapping unrelated shadows in __kvm_set_memory_region()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 11 Apr 2012 11:11:07 +0800
Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx> wrote:

> >  restart:
> > -	list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, link)
> > -		if (kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list))
> > -			goto restart;
> > +	zapped = 0;
> > +	list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, link) {
> > +		if ((slot >= 0) && !test_bit(slot, sp->slot_bitmap))
> > +			continue;
> > +
> > +		zapped |= kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list);
> 
> 
> You should "goto restart" here like the origin code, also, "safe" version of
> list_for_each is not needed.


Thank you for looking into this part.

I understand that we can eliminate _safe in the original implementation.


Can you tell me the reason why we should do "goto restart" immediately here?
For performance, or correctness issue?

I thought doing "goto restart" after the list scan would be more efficient.

	Takuya
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux