From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by kanga.kvack.org (Postfix) with ESMTP id E78166B0038 for ; Tue, 9 Sep 2014 20:11:27 -0400 (EDT) Received: by mail-pa0-f54.google.com with SMTP id lj1so7251938pab.41 for ; Tue, 09 Sep 2014 17:11:27 -0700 (PDT) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id td1si25321190pbc.140.2014.09.09.17.11.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 17:11:27 -0700 (PDT) Date: Tue, 9 Sep 2014 17:11:25 -0700 From: Andrew Morton Subject: Re: [PATCH 2/3] slub: fallback to node_to_mem_node() node if allocating on memoryless node Message-Id: <20140909171125.de9844579d55599c59260afb@linux-foundation.org> In-Reply-To: <20140909190514.GE22906@linux.vnet.ibm.com> References: <20140909190154.GC22906@linux.vnet.ibm.com> <20140909190326.GD22906@linux.vnet.ibm.com> <20140909190514.GE22906@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Nishanth Aravamudan Cc: Joonsoo Kim , David Rientjes , Han Pingtian , Pekka Enberg , Paul Mackerras , Benjamin Herrenschmidt , Michael Ellerman , Anton Blanchard , Matt Mackall , Christoph Lameter , Wanpeng Li , Tejun Heo , Linux Memory Management List , linuxppc-dev@lists.ozlabs.org On Tue, 9 Sep 2014 12:05:14 -0700 Nishanth Aravamudan wrote: > From: Joonsoo Kim > > Update the SLUB code to search for partial slabs on the nearest node > with memory in the presence of memoryless nodes. Additionally, do not > consider it to be an ALLOC_NODE_MISMATCH (and deactivate the slab) when > a memoryless-node specified allocation goes off-node. > > ... > > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1699,7 +1699,12 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, > struct kmem_cache_cpu *c) > { > void *object; > - int searchnode = (node == NUMA_NO_NODE) ? numa_mem_id() : node; > + int searchnode = node; > + > + if (node == NUMA_NO_NODE) > + searchnode = numa_mem_id(); > + else if (!node_present_pages(node)) > + searchnode = node_to_mem_node(node); I expect a call to node_to_mem_node() will always be preceded by a test of node_present_pages(). Perhaps node_to_mem_node() should just do the node_present_pages() call itself? -- 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