[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437749126-25867-4-git-send-email-vbabka@suse.cz>
Date: Fri, 24 Jul 2015 16:45:26 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>,
David Rientjes <rientjes@...gle.com>,
Greg Thelen <gthelen@...gle.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Vlastimil Babka <vbabka@...e.cz>
Subject: [RFC v2 4/4] mm: fallback for offline nodes in alloc_pages_node
alloc_pages_node() now warns when an offline node is passed. Make it fallback
to the local (or nearest) node as if NUMA_NO_NODE nid is passed, but keep the
VM_WARN_ON warning.
Suggested-by: David Rientjes <rientjes@...gle.com>
Signed-off-by: Vlastimil Babka <vbabka@...e.cz>
---
David's suggested if(VM_WARN_ON(...)) doesn't work that way, hence this more
involved and awkward syntax.
include/linux/gfp.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 531c72d..104a027 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -321,8 +321,12 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
unsigned int order)
{
/* Unknown node is current (or closest) node */
- if (nid == NUMA_NO_NODE)
+ if (nid == NUMA_NO_NODE) {
nid = numa_mem_id();
+ } else if (!node_online(nid)) {
+ VM_WARN_ON(!node_online(nid));
+ nid = numa_mem_id();
+ }
return __alloc_pages_node(nid, gfp_mask, order);
}
--
2.4.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists