Re: [kvm PATCH v3 1/1] kvm: vmx: use vmalloc() to allocate vcpus

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

 



On Wed, Oct 24, 2018 at 12:39:12PM -0700, Marc Orr wrote:
> Previously, vcpus were allocated through the kmem_cache_zalloc() API,
> which requires the underlying physical memory to be contiguous.
> Because the x86 vcpu struct, struct vcpu_vmx, is relatively large
> (e.g., currently 47680 bytes on my setup), it can become hard to find
> contiguous memory.
> 
> At the same time, the comments in the code indicate that the primary
> reason for using the kmem_cache_zalloc() API is to align the memory
> rather than to provide physical contiguity.
> 
> Thus, this patch updates the vcpu allocation logic for vmx to use the
> vmalloc() API.
> 
> Note, this patch uses the __vmalloc_node_range() API, which is in the
> include/linux/vmalloc.h file. To use __vmalloc_node_range(), this patch
> exports the API.

Oops ;-)

> +void *vzalloc_account(unsigned long size)
> +{
> +	return __vmalloc_node_flags(size, NUMA_NO_NODE,
> +				GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT);
> +}
> +EXPORT_SYMBOL(vzalloc_account);

For the mm parts:

Reviewed-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux