aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2012-11-16 04:37:58 -0500
committerMel Gorman <mgorman@suse.de>2012-12-11 09:42:44 -0500
commita720094ded8cbb303111035be91858011d2eac71 (patch)
treeceb9a2cf7f415e44f4f62a324382ec1de4a3bead /mm/mempolicy.c
parent4b10e7d562c90d0a72f324832c26653947a07381 (diff)
mm: mempolicy: Hide MPOL_NOOP and MPOL_MF_LAZY from userspace for now
The use of MPOL_NOOP and MPOL_MF_LAZY to allow an application to explicitly request lazy migration is a good idea but the actual API has not been well reviewed and once released we have to support it. For now this patch prevents an application using the services. This will need to be revisited. Signed-off-by: Mel Gorman <mgorman@suse.de>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 75d4600a5e92..a7a62fe7c280 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -252,7 +252,7 @@ static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags,
252 pr_debug("setting mode %d flags %d nodes[0] %lx\n", 252 pr_debug("setting mode %d flags %d nodes[0] %lx\n",
253 mode, flags, nodes ? nodes_addr(*nodes)[0] : -1); 253 mode, flags, nodes ? nodes_addr(*nodes)[0] : -1);
254 254
255 if (mode == MPOL_DEFAULT || mode == MPOL_NOOP) { 255 if (mode == MPOL_DEFAULT) {
256 if (nodes && !nodes_empty(*nodes)) 256 if (nodes && !nodes_empty(*nodes))
257 return ERR_PTR(-EINVAL); 257 return ERR_PTR(-EINVAL);
258 return NULL; 258 return NULL;
@@ -1186,7 +1186,7 @@ static long do_mbind(unsigned long start, unsigned long len,
1186 if (start & ~PAGE_MASK) 1186 if (start & ~PAGE_MASK)
1187 return -EINVAL; 1187 return -EINVAL;
1188 1188
1189 if (mode == MPOL_DEFAULT || mode == MPOL_NOOP) 1189 if (mode == MPOL_DEFAULT)
1190 flags &= ~MPOL_MF_STRICT; 1190 flags &= ~MPOL_MF_STRICT;
1191 1191
1192 len = (len + PAGE_SIZE - 1) & PAGE_MASK; 1192 len = (len + PAGE_SIZE - 1) & PAGE_MASK;
@@ -1241,7 +1241,7 @@ static long do_mbind(unsigned long start, unsigned long len,
1241 flags | MPOL_MF_INVERT, &pagelist); 1241 flags | MPOL_MF_INVERT, &pagelist);
1242 1242
1243 err = PTR_ERR(vma); /* maybe ... */ 1243 err = PTR_ERR(vma); /* maybe ... */
1244 if (!IS_ERR(vma) && mode != MPOL_NOOP) 1244 if (!IS_ERR(vma))
1245 err = mbind_range(mm, start, end, new); 1245 err = mbind_range(mm, start, end, new);
1246 1246
1247 if (!err) { 1247 if (!err) {
@@ -2530,7 +2530,6 @@ static const char * const policy_modes[] =
2530 [MPOL_BIND] = "bind", 2530 [MPOL_BIND] = "bind",
2531 [MPOL_INTERLEAVE] = "interleave", 2531 [MPOL_INTERLEAVE] = "interleave",
2532 [MPOL_LOCAL] = "local", 2532 [MPOL_LOCAL] = "local",
2533 [MPOL_NOOP] = "noop", /* should not actually be used */
2534}; 2533};
2535 2534
2536 2535
@@ -2581,7 +2580,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
2581 break; 2580 break;
2582 } 2581 }
2583 } 2582 }
2584 if (mode >= MPOL_MAX || mode == MPOL_NOOP) 2583 if (mode >= MPOL_MAX)
2585 goto out; 2584 goto out;
2586 2585
2587 switch (mode) { 2586 switch (mode) {