diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2006-01-06 03:10:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:23 -0500 |
commit | 21abb1478a87e26f5fa71dbcb7cf4264272c2248 (patch) | |
tree | 01e9a76ec55975b509aa721ad7d9e9cce89d9c82 /mm/mempolicy.c | |
parent | 5da7ca86078964cbfe6c83efc1205904587706fe (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>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 48 |
1 files changed, 0 insertions, 48 deletions
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 */ | ||
969 | int 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 */ | ||
989 | int 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. |