Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273248
b: refs/heads/master
c: 89e8a24
h: refs/heads/master
v: v3
  • Loading branch information
David Rientjes authored and Linus Torvalds committed Nov 2, 2011
1 parent 3772410 commit 4b5b77c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 61600f578fbd2e8ad0c90bddb9c729e7628d3813
refs/heads/master: 89e8a244b97e48f1f30e898b6f32acca477f2a13
9 changes: 6 additions & 3 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ static void cpuset_migrate_mm(struct mm_struct *mm, const nodemask_t *from,
static void cpuset_change_task_nodemask(struct task_struct *tsk,
nodemask_t *newmems)
{
bool masks_disjoint = !nodes_intersects(*newmems, tsk->mems_allowed);

repeat:
/*
* Allow tasks that have access to memory reserves because they have
Expand All @@ -963,7 +965,6 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk,
nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems);
mpol_rebind_task(tsk, newmems, MPOL_REBIND_STEP1);


/*
* ensure checking ->mems_allowed_change_disable after setting all new
* allowed nodes.
Expand All @@ -980,9 +981,11 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk,

/*
* Allocation of memory is very fast, we needn't sleep when waiting
* for the read-side.
* for the read-side. No wait is necessary, however, if at least one
* node remains unchanged.
*/
while (ACCESS_ONCE(tsk->mems_allowed_change_disable)) {
while (masks_disjoint &&
ACCESS_ONCE(tsk->mems_allowed_change_disable)) {
task_unlock(tsk);
if (!task_curr(tsk))
yield();
Expand Down

0 comments on commit 4b5b77c

Please sign in to comment.