aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@engr.sgi.com>2006-01-06 03:10:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:23 -0500
commit21abb1478a87e26f5fa71dbcb7cf4264272c2248 (patch)
tree01e9a76ec55975b509aa721ad7d9e9cce89d9c82
parent5da7ca86078964cbfe6c83efc1205904587706fe (diff)
[PATCH] Remove old node based policy interface from mempolicy.c
mempolicy.c contains provisional interface for huge page allocation based on node numbers. This is in use in SLES9 but was never used (AFAIK) in upstream versions of Linux. Huge page allocations now use zonelists to figure out where to allocate pages. The use of zonelists allows us to find the closest hugepage which was the consideration of the NUMA distance for huge page allocations. Remove the obsolete functions. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Andi Kleen <ak@muc.de> Acked-by: William Lee Irwin III <wli@holomorphy.com> Cc: Adam Litke <agl@us.ibm.com> Acked-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--include/linux/mempolicy.h19
-rw-r--r--mm/mempolicy.c48
2 files changed, 0 insertions, 67 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 817db6427113..b972f985a3c5 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -110,14 +110,6 @@ static inline int mpol_equal(struct mempolicy *a, struct mempolicy *b)
110#define mpol_set_vma_default(vma) ((vma)->vm_policy = NULL) 110#define mpol_set_vma_default(vma) ((vma)->vm_policy = NULL)
111 111
112/* 112/*
113 * Hugetlb policy. i386 hugetlb so far works with node numbers
114 * instead of zone lists, so give it special interfaces for now.
115 */
116extern int mpol_first_node(struct vm_area_struct *vma, unsigned long addr);
117extern int mpol_node_valid(int nid, struct vm_area_struct *vma,
118 unsigned long addr);
119
120/*
121 * Tree of shared policies for a shared memory region. 113 * Tree of shared policies for a shared memory region.
122 * Maintain the policies in a pseudo mm that contains vmas. The vmas 114 * Maintain the policies in a pseudo mm that contains vmas. The vmas
123 * carry the policy. As a special twist the pseudo mm is indexed in pages, not 115 * carry the policy. As a special twist the pseudo mm is indexed in pages, not
@@ -184,17 +176,6 @@ static inline struct mempolicy *mpol_copy(struct mempolicy *old)
184 return NULL; 176 return NULL;
185} 177}
186 178
187static inline int mpol_first_node(struct vm_area_struct *vma, unsigned long a)
188{
189 return numa_node_id();
190}
191
192static inline int
193mpol_node_valid(int nid, struct vm_area_struct *vma, unsigned long a)
194{
195 return 1;
196}
197
198struct shared_policy {}; 179struct shared_policy {};
199 180
200static inline int mpol_set_shared_policy(struct shared_policy *info, 181static inline int mpol_set_shared_policy(struct shared_policy *info,
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 45c51ac63443..96714e2646ad 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -961,54 +961,6 @@ void __mpol_free(struct mempolicy *p)
961} 961}
962 962
963/* 963/*
964 * Hugetlb policy. Same as above, just works with node numbers instead of
965 * zonelists.
966 */
967
968/* Find first node suitable for an allocation */
969int mpol_first_node(struct vm_area_struct *vma, unsigned long addr)
970{
971 struct mempolicy *pol = get_vma_policy(current, vma, addr);
972
973 switch (pol->policy) {
974 case MPOL_DEFAULT:
975 return numa_node_id();
976 case MPOL_BIND:
977 return pol->v.zonelist->zones[0]->zone_pgdat->node_id;
978 case MPOL_INTERLEAVE:
979 return interleave_nodes(pol);
980 case MPOL_PREFERRED:
981 return pol->v.preferred_node >= 0 ?
982 pol->v.preferred_node : numa_node_id();
983 }
984 BUG();
985 return 0;
986}
987
988/* Find secondary valid nodes for an allocation */
989int mpol_node_valid(int nid, struct vm_area_struct *vma, unsigned long addr)
990{
991 struct mempolicy *pol = get_vma_policy(current, vma, addr);
992
993 switch (pol->policy) {
994 case MPOL_PREFERRED:
995 case MPOL_DEFAULT:
996 case MPOL_INTERLEAVE:
997 return 1;
998 case MPOL_BIND: {
999 struct zone **z;
1000 for (z = pol->v.zonelist->zones; *z; z++)
1001 if ((*z)->zone_pgdat->node_id == nid)
1002 return 1;
1003 return 0;
1004 }
1005 default:
1006 BUG();
1007 return 0;
1008 }
1009}
1010
1011/*
1012 * Shared memory backing store policy support. 964 * Shared memory backing store policy support.
1013 * 965 *
1014 * Remember policies even when nobody has shared memory mapped. 966 * Remember policies even when nobody has shared memory mapped.