From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932621AbcJLJnr (ORCPT ); Wed, 12 Oct 2016 05:43:47 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35106 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932284AbcJLJnl (ORCPT ); Wed, 12 Oct 2016 05:43:41 -0400 Date: Wed, 12 Oct 2016 11:43:38 +0200 From: Michal Hocko To: Anshuman Khandual Cc: Linux Kernel Mailing List , Linux Memory Management List , Andrew Morton , Mel Gorman , "Aneesh Kumar K.V" , Balbir Singh , Vlastimil Babka , Minchan Kim Subject: Re: MPOL_BIND on memory only nodes Message-ID: <20161012094337.GH17128@dhcp22.suse.cz> References: <57FE0184.6030008@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57FE0184.6030008@linux.vnet.ibm.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 12-10-16 14:55:24, Anshuman Khandual wrote: > Hi, > > We have the following function policy_zonelist() which selects a zonelist > during various allocation paths. With this, general user space allocations > (IIUC might not have __GFP_THISNODE) fails while trying to get memory from > a memory only node without CPUs as the application runs some where else > and that node is not part of the nodemask. I am not sure I understand. So you have a task with MPOL_BIND without a cpu less node in the mask and you are wondering why the memory is not allocated from that node? > Why we insist on __GFP_THISNODE ? AFAIU __GFP_THISNODE just overrides the given node to the policy nodemask in case the current node is not part of that node mask. In other words we are ignoring the given node and use what the policy says. I can see how this can be confusing especially when confronting the documentation: * __GFP_THISNODE forces the allocation to be satisified from the requested * node with no fallbacks or placement policy enforcements. -- Michal Hocko SUSE Labs