Commit a720094ded8cbb303111035be91858011d2eac71
1 parent
4b10e7d562
Exists in
master
and in
20 other branches
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>
Showing 2 changed files with 5 additions and 8 deletions Side-by-side Diff
include/uapi/linux/mempolicy.h
... | ... | @@ -21,7 +21,6 @@ |
21 | 21 | MPOL_BIND, |
22 | 22 | MPOL_INTERLEAVE, |
23 | 23 | MPOL_LOCAL, |
24 | - MPOL_NOOP, /* retain existing policy for range */ | |
25 | 24 | MPOL_MAX, /* always last member of enum */ |
26 | 25 | }; |
27 | 26 | |
... | ... | @@ -57,8 +56,7 @@ |
57 | 56 | |
58 | 57 | #define MPOL_MF_VALID (MPOL_MF_STRICT | \ |
59 | 58 | MPOL_MF_MOVE | \ |
60 | - MPOL_MF_MOVE_ALL | \ | |
61 | - MPOL_MF_LAZY) | |
59 | + MPOL_MF_MOVE_ALL) | |
62 | 60 | |
63 | 61 | /* |
64 | 62 | * Internal flags that share the struct mempolicy flags word with |
mm/mempolicy.c
... | ... | @@ -252,7 +252,7 @@ |
252 | 252 | pr_debug("setting mode %d flags %d nodes[0] %lx\n", |
253 | 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 | 256 | if (nodes && !nodes_empty(*nodes)) |
257 | 257 | return ERR_PTR(-EINVAL); |
258 | 258 | return NULL; |
... | ... | @@ -1186,7 +1186,7 @@ |
1186 | 1186 | if (start & ~PAGE_MASK) |
1187 | 1187 | return -EINVAL; |
1188 | 1188 | |
1189 | - if (mode == MPOL_DEFAULT || mode == MPOL_NOOP) | |
1189 | + if (mode == MPOL_DEFAULT) | |
1190 | 1190 | flags &= ~MPOL_MF_STRICT; |
1191 | 1191 | |
1192 | 1192 | len = (len + PAGE_SIZE - 1) & PAGE_MASK; |
... | ... | @@ -1241,7 +1241,7 @@ |
1241 | 1241 | flags | MPOL_MF_INVERT, &pagelist); |
1242 | 1242 | |
1243 | 1243 | err = PTR_ERR(vma); /* maybe ... */ |
1244 | - if (!IS_ERR(vma) && mode != MPOL_NOOP) | |
1244 | + if (!IS_ERR(vma)) | |
1245 | 1245 | err = mbind_range(mm, start, end, new); |
1246 | 1246 | |
1247 | 1247 | if (!err) { |
... | ... | @@ -2530,7 +2530,6 @@ |
2530 | 2530 | [MPOL_BIND] = "bind", |
2531 | 2531 | [MPOL_INTERLEAVE] = "interleave", |
2532 | 2532 | [MPOL_LOCAL] = "local", |
2533 | - [MPOL_NOOP] = "noop", /* should not actually be used */ | |
2534 | 2533 | }; |
2535 | 2534 | |
2536 | 2535 | |
... | ... | @@ -2581,7 +2580,7 @@ |
2581 | 2580 | break; |
2582 | 2581 | } |
2583 | 2582 | } |
2584 | - if (mode >= MPOL_MAX || mode == MPOL_NOOP) | |
2583 | + if (mode >= MPOL_MAX) | |
2585 | 2584 | goto out; |
2586 | 2585 | |
2587 | 2586 | switch (mode) { |
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit 2c0346
-
mentioned in commit d645fc
-
mentioned in commit d645fc