Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1210446
| From | Vlastimil Babka <vbabka@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/3] mm: use numa_mem_id() in alloc_pages_node() |
| Date | 2015-08-20 13:50 +0200 |
| Message-ID | <pZww2-3MB-21@gated-at.bofh.it> (permalink) |
| References | <pZww2-3MB-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
alloc_pages_node() might fail when called with NUMA_NO_NODE and
__GFP_THISNODE on a CPU belonging to a memoryless node. To make the
local-node fallback more robust and prevent such situations, use
numa_mem_id(), which was introduced for similar scenarios in the slab
context.
Suggested-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Christoph Lameter <cl@linux.com>
---
v3: better commit message
include/linux/gfp.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4a12cae2..f92cbd2 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -318,13 +318,14 @@ __alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order)
/*
* Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,
- * prefer the current CPU's node. Otherwise node must be valid and online.
+ * prefer the current CPU's closest node. Otherwise node must be valid and
+ * online.
*/
static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
unsigned int order)
{
if (nid == NUMA_NO_NODE)
- nid = numa_node_id();
+ nid = numa_mem_id();
return __alloc_pages_node(nid, gfp_mask, order);
}
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/3] mm: rename alloc_pages_exact_node to __alloc_pages_node Vlastimil Babka <vbabka@suse.cz> - 2015-08-20 13:50 +0200
[PATCH 2/3] mm: unify checks in alloc_pages_node() and __alloc_pages_node() Vlastimil Babka <vbabka@suse.cz> - 2015-08-20 13:50 +0200
Re: [PATCH 2/3] mm: unify checks in alloc_pages_node() and __alloc_pages_node() Michal Hocko <mhocko@kernel.org> - 2015-08-20 16:20 +0200
Re: [PATCH 2/3] mm: unify checks in alloc_pages_node() and __alloc_pages_node() Michal Hocko <mhocko@kernel.org> - 2015-08-20 16:50 +0200
[PATCH 3/3] mm: use numa_mem_id() in alloc_pages_node() Vlastimil Babka <vbabka@suse.cz> - 2015-08-20 13:50 +0200
Re: [PATCH 1/3] mm: rename alloc_pages_exact_node to __alloc_pages_node Michal Hocko <mhocko@kernel.org> - 2015-08-20 16:10 +0200
csiph-web