diff options
author | Juergen Gross <juergen.gross@ts.fujitsu.com> | 2011-11-18 13:34:43 +0000 |
---|---|---|
committer | Juergen Gross <juergen.gross@ts.fujitsu.com> | 2011-11-18 13:34:43 +0000 |
commit | f42d7a66bf44fdff582a4e2ff2c33e99a579c0d4 (patch) | |
tree | 4c649865d20d1d9caf54ec4556cc6ea04a212a42 /xen/common/cpupool.c | |
parent | 95ad9f65c972a3439ae6d11243373be16f71cb94 (diff) | |
download | xen-f42d7a66bf44fdff582a4e2ff2c33e99a579c0d4.tar.gz xen-f42d7a66bf44fdff582a4e2ff2c33e99a579c0d4.tar.bz2 xen-f42d7a66bf44fdff582a4e2ff2c33e99a579c0d4.zip |
sched_sedf: Avoid panic when adjusting sedf parameters
When using sedf scheduler in a cpupool the system might panic when
setting sedf scheduling parameters for a domain. Introduces
for_each_domain_in_cpupool macro as it is usable 4 times now. Add
appropriate locking in cpupool_unassign_cpu().
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/cpupool.c')
-rw-r--r-- | xen/common/cpupool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index fcc44b1e57..45162ad708 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -309,10 +309,9 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu) if ( (c->n_dom > 0) && (cpumask_weight(c->cpu_valid) == 1) && (cpu != cpupool_moving_cpu) ) { - for_each_domain(d) + rcu_read_lock(&domlist_read_lock); + for_each_domain_in_cpupool(d, c) { - if ( d->cpupool != c ) - continue; if ( !d->is_dying ) { ret = -EBUSY; @@ -327,6 +326,7 @@ int cpupool_unassign_cpu(struct cpupool *c, unsigned int cpu) } cpupool0->n_dom++; } + rcu_read_unlock(&domlist_read_lock); if ( ret ) goto out; } |