aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/mempolicy.h2
2 files changed, 7 insertions, 3 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
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 59c4865bc85f..69160dc32d48 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -241,7 +241,7 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p)
241static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 241static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
242 unsigned long addr, gfp_t gfp_flags, struct mempolicy **mpol) 242 unsigned long addr, gfp_t gfp_flags, struct mempolicy **mpol)
243{ 243{
244 return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags); 244 return node_zonelist(0, gfp_flags);
245} 245}
246 246
247static inline int do_migrate_pages(struct mm_struct *mm, 247static inline int do_migrate_pages(struct mm_struct *mm,