On Sun, 29 Jan 2012 13:01:18 +0200
Avi Kivity <a...@redhat.com> wrote:

> > Tested by attaching a debugger to a running qemu w/kvm and running
> > "call munmap(0, 1UL << 46)".
> >
> 
> How about computing the intersection of (start, end) with the hva ranges
> in kvm->memslots?
> 
> If there is no intersection, you exit immediately.

I think introducing kvm_handle_hva_range() is the right thing if we really
care about unmapping large area at once.

Current iteration:
for each page
        for each slot
                for each level

My suggestion:
for each slot
        for each level
                for each page

This way compiler can optimize the task to be a simple iteration over the
rmap array.

But I could not imagine why unmapping 128GB is needed.
mmu_notifier will not do such crazy thing.

        Takuya

> 
> It's still possible for the work to drop the intersection to be larger
> than dropping the entire shadow, but it's unlikely.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to