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.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index e865d51f1c74..e1c6064cb6c7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -151,17 +151,26 @@ static inline enum zone_type gfp_zone(gfp_t flags)
151 * virtual kernel addresses to the allocated page(s). 151 * virtual kernel addresses to the allocated page(s).
152 */ 152 */
153 153
154static inline int gfp_zonelist(gfp_t flags)
155{
156 if (NUMA_BUILD && unlikely(flags & __GFP_THISNODE))
157 return 1;
158
159 return 0;
160}
161
154/* 162/*
155 * We get the zone list from the current node and the gfp_mask. 163 * 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. 164 * This zone list contains a maximum of MAXNODES*MAX_NR_ZONES zones.
157 * There are many zonelists per node, two for each active zone. 165 * There are two zonelists per node, one for all zones with memory and
166 * one containing just zones from the node the zonelist belongs to.
158 * 167 *
159 * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets 168 * For the normal case of non-DISCONTIGMEM systems the NODE_DATA() gets
160 * optimized to &contig_page_data at compile-time. 169 * optimized to &contig_page_data at compile-time.
161 */ 170 */
162static inline struct zonelist *node_zonelist(int nid, gfp_t flags) 171static inline struct zonelist *node_zonelist(int nid, gfp_t flags)
163{ 172{
164 return NODE_DATA(nid)->node_zonelists + gfp_zone(flags); 173 return NODE_DATA(nid)->node_zonelists + gfp_zonelist(flags);
165} 174}
166 175
167#ifndef HAVE_ARCH_FREE_PAGE 176#ifndef HAVE_ARCH_FREE_PAGE