Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94032
b: refs/heads/master
c: f4e53d9
h: refs/heads/master
v: v3
  • Loading branch information
Lee Schermerhorn authored and Linus Torvalds committed Apr 28, 2008
1 parent 57ee047 commit d0f6155
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 846a16bf0fc80dc95a414ffce465e3cbf9680247
refs/heads/master: f4e53d910b7dde2685b177f1e7c3e3e0b4a42f7b
13 changes: 13 additions & 0 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,16 +591,29 @@ static long do_set_mempolicy(unsigned short mode, unsigned short flags,
nodemask_t *nodes)
{
struct mempolicy *new;
struct mm_struct *mm = current->mm;

new = mpol_new(mode, flags, nodes);
if (IS_ERR(new))
return PTR_ERR(new);

/*
* prevent changing our mempolicy while show_numa_maps()
* is using it.
* Note: do_set_mempolicy() can be called at init time
* with no 'mm'.
*/
if (mm)
down_write(&mm->mmap_sem);
mpol_put(current->mempolicy);
current->mempolicy = new;
mpol_set_task_struct_flag();
if (new && new->policy == MPOL_INTERLEAVE &&
nodes_weight(new->v.nodes))
current->il_next = first_node(new->v.nodes);
if (mm)
up_write(&mm->mmap_sem);

return 0;
}

Expand Down

0 comments on commit d0f6155

Please sign in to comment.