Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350347
b: refs/heads/master
c: 02bb586
h: refs/heads/master
i:
  350345: bea5878
  350343: f44dfc4
v: v3
  • Loading branch information
Tejun Heo committed Jan 7, 2013
1 parent 8eb4922 commit c2939f3
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 452477fa68c6d8ef80adebd05194c1c157ad9a53
refs/heads/master: 02bb586372a71595203b3ff19a9be48eaa076f6c
14 changes: 14 additions & 0 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ static struct workqueue_struct *cpuset_propagate_hotplug_wq;

static void cpuset_hotplug_workfn(struct work_struct *work);
static void cpuset_propagate_hotplug_workfn(struct work_struct *work);
static void schedule_cpuset_propagate_hotplug(struct cpuset *cs);

static DECLARE_WORK(cpuset_hotplug_work, cpuset_hotplug_workfn);

Expand Down Expand Up @@ -1464,6 +1465,14 @@ static void cpuset_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
}

cs->attach_in_progress--;

/*
* We may have raced with CPU/memory hotunplug. Trigger hotplug
* propagation if @cs doesn't have any CPU or memory. It will move
* the newly added tasks to the nearest parent which can execute.
*/
if (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed))
schedule_cpuset_propagate_hotplug(cs);
}

/* The various types of files and directories in a cpuset file system */
Expand Down Expand Up @@ -1569,8 +1578,13 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
* resources, wait for the previously scheduled operations before
* proceeding, so that we don't end up keep removing tasks added
* after execution capability is restored.
*
* Flushing cpuset_hotplug_work is enough to synchronize against
* hotplug hanlding; however, cpuset_attach() may schedule
* propagation work directly. Flush the workqueue too.
*/
flush_work(&cpuset_hotplug_work);
flush_workqueue(cpuset_propagate_hotplug_wq);

if (!cgroup_lock_live_group(cgrp))
return -ENODEV;
Expand Down

0 comments on commit c2939f3

Please sign in to comment.