Re: [PATCH] mm: rename and document alloc_pages_exact_node

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

 



On Wed, 22 Jul 2015, Paolo Bonzini wrote:

> > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> > index 2d73807..a8723a8 100644
> > --- a/arch/x86/kvm/vmx.c
> > +++ b/arch/x86/kvm/vmx.c
> > @@ -3158,7 +3158,7 @@ static struct vmcs *alloc_vmcs_cpu(int cpu)
> >  	struct page *pages;
> >  	struct vmcs *vmcs;
> >  
> > -	pages = alloc_pages_exact_node(node, GFP_KERNEL, vmcs_config.order);
> > +	pages = alloc_pages_prefer_node(node, GFP_KERNEL, vmcs_config.order);
> >  	if (!pages)
> >  		return NULL;
> >  	vmcs = page_address(pages);
> 
> Even though there's a pretty strong preference for the "right" node,
> things can work if the node is the wrong one.  The order is always zero
> in practice, so the allocation should succeed.
> 

You're code is fine both before and after the patch since __GFP_THISNODE 
isn't set.  The allocation will eventually succeed but, as you said, may 
be from remote memory (and the success of allocating on node may be 
influenced by the global setting of zone_reclaim_mode).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



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