Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344788
b: refs/heads/master
c: d3a7103
h: refs/heads/master
v: v3
  • Loading branch information
Lee Schermerhorn authored and Mel Gorman committed Dec 11, 2012
1 parent a77259b commit d014763
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 479e2802d09f1e18a97262c4c6f8f17ae5884bd8
refs/heads/master: d3a710337b0590f43fd236d5e6518439afc7410a
1 change: 1 addition & 0 deletions trunk/include/uapi/linux/mempolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum {
MPOL_BIND,
MPOL_INTERLEAVE,
MPOL_LOCAL,
MPOL_NOOP, /* retain existing policy for range */
MPOL_MAX, /* always last member of enum */
};

Expand Down
11 changes: 6 additions & 5 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ static struct mempolicy *mpol_new(unsigned short mode, unsigned short flags,
pr_debug("setting mode %d flags %d nodes[0] %lx\n",
mode, flags, nodes ? nodes_addr(*nodes)[0] : -1);

if (mode == MPOL_DEFAULT) {
if (mode == MPOL_DEFAULT || mode == MPOL_NOOP) {
if (nodes && !nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
return NULL; /* simply delete any existing policy */
return NULL;
}
VM_BUG_ON(!nodes);

Expand Down Expand Up @@ -1147,7 +1147,7 @@ static long do_mbind(unsigned long start, unsigned long len,
if (start & ~PAGE_MASK)
return -EINVAL;

if (mode == MPOL_DEFAULT)
if (mode == MPOL_DEFAULT || mode == MPOL_NOOP)
flags &= ~MPOL_MF_STRICT;

len = (len + PAGE_SIZE - 1) & PAGE_MASK;
Expand Down Expand Up @@ -2409,7 +2409,8 @@ static const char * const policy_modes[] =
[MPOL_PREFERRED] = "prefer",
[MPOL_BIND] = "bind",
[MPOL_INTERLEAVE] = "interleave",
[MPOL_LOCAL] = "local"
[MPOL_LOCAL] = "local",
[MPOL_NOOP] = "noop", /* should not actually be used */
};


Expand Down Expand Up @@ -2460,7 +2461,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
break;
}
}
if (mode >= MPOL_MAX)
if (mode >= MPOL_MAX || mode == MPOL_NOOP)
goto out;

switch (mode) {
Expand Down

0 comments on commit d014763

Please sign in to comment.