aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2007-07-17 07:03:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:22:59 -0400
commit396faf0303d273219db5d7eb4a2879ad977ed185 (patch)
tree96cb64fd6713ef7a924f4f878e259aea781f079a /mm/mempolicy.c
parent2a1e274acf0b1c192face19a4be7c12d4503eaaf (diff)
Allow huge page allocations to use GFP_HIGH_MOVABLE
Huge pages are not movable so are not allocated from ZONE_MOVABLE. However, as ZONE_MOVABLE will always have pages that can be migrated or reclaimed, it can be used to satisfy hugepage allocations even when the system has been running a long time. This allows an administrator to resize the hugepage pool at runtime depending on the size of ZONE_MOVABLE. This patch adds a new sysctl called hugepages_treat_as_movable. When a non-zero value is written to it, future allocations for the huge page pool will use ZONE_MOVABLE. Despite huge pages being non-movable, we do not introduce additional external fragmentation of note as huge pages are always the largest contiguous block we care about. [akpm@linux-foundation.org: various fixes] Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4c0f99996811..9f4e9b95e8f2 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1203,7 +1203,8 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
1203 1203
1204#ifdef CONFIG_HUGETLBFS 1204#ifdef CONFIG_HUGETLBFS
1205/* Return a zonelist suitable for a huge page allocation. */ 1205/* Return a zonelist suitable for a huge page allocation. */
1206struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr) 1206struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
1207 gfp_t gfp_flags)
1207{ 1208{
1208 struct mempolicy *pol = get_vma_policy(current, vma, addr); 1209 struct mempolicy *pol = get_vma_policy(current, vma, addr);
1209 1210
@@ -1211,7 +1212,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr)
1211 unsigned nid; 1212 unsigned nid;
1212 1213
1213 nid = interleave_nid(pol, vma, addr, HPAGE_SHIFT); 1214 nid = interleave_nid(pol, vma, addr, HPAGE_SHIFT);
1214 return NODE_DATA(nid)->node_zonelists + gfp_zone(GFP_HIGHUSER); 1215 return NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_flags);
1215 } 1216 }
1216 return zonelist_policy(GFP_HIGHUSER, pol); 1217 return zonelist_policy(GFP_HIGHUSER, pol);
1217} 1218}