From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 29FE06B0253 for ; Wed, 12 Oct 2016 05:25:34 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id 190so37331429pfv.0 for ; Wed, 12 Oct 2016 02:25:34 -0700 (PDT) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id d9si987596pgg.140.2016.10.12.02.25.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Oct 2016 02:25:33 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9C9NsFo136555 for ; Wed, 12 Oct 2016 05:25:33 -0400 Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) by mx0a-001b2d01.pphosted.com with ESMTP id 261ewvawwh-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Oct 2016 05:25:32 -0400 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Oct 2016 19:25:30 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id ECC6E2BB0054 for ; Wed, 12 Oct 2016 20:25:27 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9C9PRHf6881578 for ; Wed, 12 Oct 2016 20:25:27 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9C9PRqW030275 for ; Wed, 12 Oct 2016 20:25:27 +1100 Date: Wed, 12 Oct 2016 14:55:24 +0530 From: Anshuman Khandual MIME-Version: 1.0 Subject: MPOL_BIND on memory only nodes Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Message-Id: <57FE0184.6030008@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Linux Kernel Mailing List Cc: Linux Memory Management List , Andrew Morton , Mel Gorman , Michal Hocko , "Aneesh Kumar K.V" , Balbir Singh , Vlastimil Babka , Minchan Kim 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. Why we insist on __GFP_THISNODE ? On any memory only node its likely that the local node "nd" might not be part of the nodemask, hence does it make sense to pick up the first node of the nodemask in those cases without looking for __GFP_THISNODE ? /* Return a zonelist indicated by gfp for node representing a mempolicy */ static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy, int nd) { switch (policy->mode) { case MPOL_PREFERRED: if (!(policy->flags & MPOL_F_LOCAL)) nd = policy->v.preferred_node; break; case MPOL_BIND: /* * Normally, MPOL_BIND allocations are node-local within the * allowed nodemask. However, if __GFP_THISNODE is set and the * current node isn't part of the mask, we use the zonelist for * the first node in the mask instead. */ if (unlikely(gfp & __GFP_THISNODE) && unlikely(!node_isset(nd, policy->v.nodes))) nd = first_node(policy->v.nodes); break; default: BUG(); } return node_zonelist(nd, gfp); } - Anshuman -- 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