projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7198f3c
)
mempolicy: fix get_mempolicy() for relative and static nodes
author
Lee Schermerhorn
<
[email protected]
>
Tue, 23 Mar 2010 20:35:41 +0000
(13:35 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 24 Mar 2010 23:31:22 +0000
(16:31 -0700)
Discovered while testing other mempolicy changes:
get_mempolicy() does not handle static/relative mode flags correctly.
Return the value that the user specified so that it can be restored
via set_mempolicy() if desired.
Signed-off-by: Lee Schermerhorn <
[email protected]
>
Cc: Hugh Dickins <
[email protected]
>
Cc: Ravikiran Thirumalai <
[email protected]
>
Cc: KOSAKI Motohiro <
[email protected]
>
Cc: Christoph Lameter <
[email protected]
>
Cc: David Rientjes <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/mempolicy.c
patch
|
blob
|
history
diff --git
a/mm/mempolicy.c
b/mm/mempolicy.c
index 6cdfa1df57f6d38dc2b1a7e319670cd288ce5b46..8034abd3a1351700414ad7024c16da56774522fd 100644
(file)
--- a/
mm/mempolicy.c
+++ b/
mm/mempolicy.c
@@
-806,9
+806,13
@@
static long do_get_mempolicy(int *policy, nodemask_t *nmask,
err = 0;
if (nmask) {
- task_lock(current);
- get_policy_nodemask(pol, nmask);
- task_unlock(current);
+ if (mpol_store_user_nodemask(pol)) {
+ *nmask = pol->w.user_nodemask;
+ } else {
+ task_lock(current);
+ get_policy_nodemask(pol, nmask);
+ task_unlock(current);
+ }
}
out: