From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by kanga.kvack.org (Postfix) with ESMTP id 025566B0038 for ; Fri, 24 Jul 2015 10:52:27 -0400 (EDT) Received: by wibxm9 with SMTP id xm9so32469356wib.0 for ; Fri, 24 Jul 2015 07:52:26 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id it9si4691155wid.64.2015.07.24.07.52.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jul 2015 07:52:25 -0700 (PDT) Subject: Re: [PATCH] mm: rename and document alloc_pages_exact_node References: <1437486951-19898-1-git-send-email-vbabka@suse.cz> <55AF7F64.1040602@suse.cz> From: Vlastimil Babka Message-ID: <55B25122.5030407@suse.cz> Date: Fri, 24 Jul 2015 16:52:18 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes , Christoph Lameter Cc: 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" , Pekka Enberg , Joonsoo Kim , Naoya Horiguchi , Tony Luck , Fenghua Yu , Arnd Bergmann , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Gleb Natapov , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Cliff Whickman , Robin Holt On 07/23/2015 10:27 PM, David Rientjes wrote: > On Thu, 23 Jul 2015, Christoph Lameter wrote: > >>> The only possible downside would be existing users of >>> alloc_pages_node() that are calling it with an offline node. Since it's a >>> VM_BUG_ON() that would catch that, I think it should be changed to a >>> VM_WARN_ON() and eventually fixed up because it's nonsensical. >>> VM_BUG_ON() here should be avoided. >> >> The offline node thing could be addresses by using numa_mem_id()? >> > > I was concerned about any callers that were passing an offline node, not > NUMA_NO_NODE, today. One of the alloc-node functions has a VM_BUG_ON() > for it, the other silently calls node_zonelist() on it. > > I suppose the final alloc_pages_node() implementation could be > > if (nid == NUMA_NO_NODE || VM_WARN_ON(!node_online(nid))) > nid = numa_mem_id(); > > VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); > return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); > > though. I've posted v2 based on David's and Christoph's suggestions (thanks) but to avoid spamming everyone until we agree on the final interface, it's marked as RFC and excludes the arch people from CC: http://marc.info/?l=linux-kernel&m=143774920902608&w=2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org