Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247AbbGVVoI (ORCPT ); Wed, 22 Jul 2015 17:44:08 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36005 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753091AbbGVVoF (ORCPT ); Wed, 22 Jul 2015 17:44:05 -0400 Date: Wed, 22 Jul 2015 14:44:03 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Paolo Bonzini cc: Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, cbe-oss-dev@lists.ozlabs.org, kvm@vger.kernel.org, Mel Gorman , Greg Thelen , "Aneesh Kumar K.V" , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Naoya Horiguchi , Tony Luck , Fenghua Yu , Arnd Bergmann , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Gleb Natapov , Thomas Gleixner , Ingo Molnar Subject: Re: [PATCH] mm: rename and document alloc_pages_exact_node In-Reply-To: <55AF7F28.2020504@redhat.com> Message-ID: References: <1437486951-19898-1-git-send-email-vbabka@suse.cz> <55AF7F28.2020504@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1261 Lines: 30 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/