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/sched_sedf.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/sched_sedf.c')
-rw-r--r-- | xen/common/sched_sedf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c index 76b0e9d68c..8bff90c44a 100644 --- a/xen/common/sched_sedf.c +++ b/xen/common/sched_sedf.c @@ -1304,6 +1304,8 @@ static void sedf_dump_cpu_state(const struct scheduler *ops, int i) rcu_read_lock(&domlist_read_lock); for_each_domain ( d ) { + if ( (d->cpupool ? d->cpupool->sched : &sched_sedf_def) != ops ) + continue; for_each_vcpu(d, ed) { if ( !__task_on_queue(ed) && (ed->processor == i) ) @@ -1335,10 +1337,8 @@ static int sedf_adjust_weights(struct cpupool *c, struct xen_domctl_scheduler_op /* Sum across all weights. */ rcu_read_lock(&domlist_read_lock); - for_each_domain( d ) + for_each_domain_in_cpupool( d, c ) { - if ( c != d->cpupool ) - continue; for_each_vcpu( d, p ) { if ( (cpu = p->processor) >= nr_cpus ) @@ -1367,7 +1367,7 @@ static int sedf_adjust_weights(struct cpupool *c, struct xen_domctl_scheduler_op /* Adjust all slices (and periods) to the new weight. */ rcu_read_lock(&domlist_read_lock); - for_each_domain( d ) + for_each_domain_in_cpupool( d, c ) { for_each_vcpu ( d, p ) { |