aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c48
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 */
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.