lkml.org 
[lkml]   [2012]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/7] KVM: Alleviate mmu_lock hold time when we start dirty logging
On Thu, 20 Dec 2012 06:41:27 -0700
Alex Williamson <alex.williamson@redhat.com> wrote:

> Hmm, isn't the fix as simple as:
>
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -847,7 +847,8 @@ int __kvm_set_memory_region(struct kvm *kvm,
> GFP_KERNEL);
> if (!slots)
> goto out_free;
> - }
> + } else
> + slots->generation = kvm->memslots->generation;
>
> /* map new memory slot into the iommu */
> if (npages) {
>
> Or even just slots->generation++ since we're holding the lock across all
> of this.

Yes, the fix should work, but I do not want to update the
generation from outside of update_memslots().

> The original patch can be reverted, there are no following dependencies,
> but the idea was that we're making the memslot array larger, so there
> could be more pressure in allocating it, so let's not trivially do extra
> frees and allocs. Thanks,

I agree that the current set_memory_region() is not good for frequent updates.
But the alloc/free is not a major factor at the moment: flushing shadows should
be more problematic.

Thanks,
Takuya


\
 
 \ /
  Last update: 2012-12-20 16:01    [W:0.154 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site