aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gfp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r--include/linux/gfp.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index c17ba4945203..e865d51f1c74 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -154,10 +154,15 @@ static inline enum zone_type gfp_zone(gfp_t flags)
154/* 154/*
155 * We get the zone list from the current node and the gfp_mask. 155 * We get the zone list from the current node and the gfp_mask.
156 * This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones. 156 * This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.
157 * There are many zonelists per node, two for each active zone.
157 * 158 *
158 * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets 159 * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
159 * optimized to &contig_page_data at compile-time. 160 * optimized to &contig_page_data at compile-time.
160 */ 161 */
162static inline struct zonelist *node_zonelist(int nid, gfp_t flags)
163{
164 return NODE_DATA(nid)->node_zonelists + gfp_zone(flags);
165}
161 166
162#ifndef HAVE_ARCH_FREE_PAGE 167#ifndef HAVE_ARCH_FREE_PAGE
163static inline void arch_free_page(struct page *page, int order) { } 168static inline void arch_free_page(struct page *page, int order) { }
@@ -178,8 +183,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
178 if (nid < 0) 183 if (nid < 0)
179 nid = numa_node_id(); 184 nid = numa_node_id();
180 185
181 return __alloc_pages(gfp_mask, order, 186 return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
182 NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
183} 187}
184 188
185#ifdef CONFIG_NUMA 189#ifdef CONFIG_NUMA