[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1507221442540.21468@chino.kir.corp.google.com>
Date:	Wed, 22 Jul 2015 14:44:03 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Paolo Bonzini <pbonzini@...hat.com>
cc:	Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-ia64@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	cbe-oss-dev@...ts.ozlabs.org, kvm@...r.kernel.org,
	Mel Gorman <mgorman@...e.de>, Greg Thelen <gthelen@...gle.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Christoph Lameter <cl@...ux.com>,
	Pekka Enberg <penberg@...nel.org>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Tony Luck <tony.luck@...el.com>,
	Fenghua Yu <fenghua.yu@...el.com>,
	Arnd Bergmann <arnd@...db.de>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Michael Ellerman <mpe@...erman.id.au>,
	Gleb Natapov <gleb@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] mm: rename and document alloc_pages_exact_node
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
