Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151520
b: refs/heads/master
c: f3b39d4
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Linus Torvalds committed Jun 17, 2009
1 parent f997a82 commit 7005e7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 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: dcf975d58565880a134afb13bde511d1b873ce79
refs/heads/master: f3b39d47ebc51416fc3b690a32dfe030a2035e67
27 changes: 19 additions & 8 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,24 @@ static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask)
BUG_ON(!nodes_intersects(*pmask, node_states[N_HIGH_MEMORY]));
}

/*
* update task's spread flag if cpuset's page/slab spread flag is set
*
* Called with callback_mutex/cgroup_mutex held
*/
static void cpuset_update_task_spread_flag(struct cpuset *cs,
struct task_struct *tsk)
{
if (is_spread_page(cs))
tsk->flags |= PF_SPREAD_PAGE;
else
tsk->flags &= ~PF_SPREAD_PAGE;
if (is_spread_slab(cs))
tsk->flags |= PF_SPREAD_SLAB;
else
tsk->flags &= ~PF_SPREAD_SLAB;
}

/**
* cpuset_update_task_memory_state - update task memory placement
*
Expand Down Expand Up @@ -388,14 +406,7 @@ void cpuset_update_task_memory_state(void)
cs = task_cs(tsk); /* Maybe changed when task not locked */
guarantee_online_mems(cs, &tsk->mems_allowed);
tsk->cpuset_mems_generation = cs->mems_generation;
if (is_spread_page(cs))
tsk->flags |= PF_SPREAD_PAGE;
else
tsk->flags &= ~PF_SPREAD_PAGE;
if (is_spread_slab(cs))
tsk->flags |= PF_SPREAD_SLAB;
else
tsk->flags &= ~PF_SPREAD_SLAB;
cpuset_update_task_spread_flag(cs, tsk);
task_unlock(tsk);
mutex_unlock(&callback_mutex);
mpol_rebind_task(tsk, &tsk->mems_allowed);
Expand Down

0 comments on commit 7005e7f

Please sign in to comment.