From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Date: Fri, 11 Jul 2014 15:13:57 +0000 Subject: Re: [RFC Patch V1 07/30] mm: Use cpu_to_mem()/numa_mem_id() to support memoryless node Message-Id: List-Id: References: <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com> <1405064267-11678-8-git-send-email-jiang.liu@linux.intel.com> <20140711144205.GA27706@htj.dyndns.org> In-Reply-To: <20140711144205.GA27706@htj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tejun Heo Cc: Jiang Liu , Andrew Morton , Mel Gorman , David Rientjes , Mike Galbraith , Peter Zijlstra , "Rafael J . Wysocki" , Vladimir Davydov , Johannes Weiner , "Kirill A. Shutemov" , Rik van Riel , Wanpeng Li , Zhang Yanfei , Catalin Marinas , Jianyu Zhan , malc , Joonsoo Kim , Fabian Frederick , Tony Luck , linux-mm@kvack.org, linux-hotplug@vger.kernel.org, linux-kernel@vger.kernel.org On Fri, 11 Jul 2014, Tejun Heo wrote: > Hello, > > On Fri, Jul 11, 2014 at 03:37:24PM +0800, Jiang Liu wrote: > > When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id() > > may return a node without memory, and later cause system failure/panic > > when calling kmalloc_node() and friends with returned node id. > > The patch itself looks okay to me but is this the right way to handle > this? Can't we just let the allocators fall back to the nearest node > with memory? Why do we need to impose this awareness of memory-less > node on all the users? Allocators typically fall back but they wont in some cases if you say that you want memory from a particular node. A GFP_THISNODE would force a failure of the alloc. In other cases it should fall back. I am not sure that all allocations obey these conventions though.