Re: How KVM hypervisor allocates physical pages to the VM.

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

 



Hi, Paolo,
As you said the memory pages may have already be touched by the guest,
although it still cause page fault from the VM.

So my question is will KVM pre-allocate some physical pages (by
calling get_user_page_fast) to the guest?
If so, when a user-space program in the guest requests for pages, how
does KVM decide which pre-allocated physical pages are to be
allocated?

Because in this microbenchmark, for each virtual page fault in the
guest, I can trace there is a corresponding kvm_page_fault event, but
not mm_alloc_page event (which is the function of allocating page by
the buddy allocator).

Thanks in advance.

- Steven

On Wed, Sep 17, 2014 at 3:22 PM, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
> Il 17/09/2014 19:19, Steven ha scritto:
>> I think get_user_pages or get_user_pages finally will call
>> mm_page_alloc, right?.
>> However, for the small size array, I observer many
>> kmem_cache_alloc_node and kmalloc_node physical page allocation, but
>> very few mm_page_alloc trace. So will the host kernel assign the
>> memory to the VM from slab allocator? Thanks.
>
> I don't think so.  Likely the memory had already been touched by the guest.
>
> Paolo
--
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