diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-09-22 14:37:31 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-09-22 14:37:31 +0100 |
commit | 13fe69b4a731ddd43b27f888c0a7e79c55ff6c8a (patch) | |
tree | 2ef6f237bbe338b30f116125041e90fa63ef094c /xen/common/sched_sedf.c | |
parent | 13ad235ee7a5a05cb9e5eee8fce3a8255cb5e380 (diff) | |
download | xen-13fe69b4a731ddd43b27f888c0a7e79c55ff6c8a.tar.gz xen-13fe69b4a731ddd43b27f888c0a7e79c55ff6c8a.tar.bz2 xen-13fe69b4a731ddd43b27f888c0a7e79c55ff6c8a.zip |
Fix misc issues related to allowing support of more CPUs
This mainly means removing stack variables that (should) depend on
NR_CPUS (other than cpumask_t ones) and adjusting certain array sizes.
There's at least one open tools issue: The 'xm vcpu-pin' path assumes
a maximum of 64 CPU-s in many places.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/common/sched_sedf.c')
-rw-r--r-- | xen/common/sched_sedf.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c index 7b4eafb632..4bf3c80a89 100644 --- a/xen/common/sched_sedf.c +++ b/xen/common/sched_sedf.c @@ -1298,8 +1298,18 @@ static int sedf_adjust_weights(struct xen_domctl_scheduler_op *cmd) { struct vcpu *p; struct domain *d; - int sumw[NR_CPUS] = { 0 }; - s_time_t sumt[NR_CPUS] = { 0 }; + unsigned int nr_cpus = last_cpu(cpu_possible_map) + 1; + int *sumw = xmalloc_array(int, nr_cpus); + s_time_t *sumt = xmalloc_array(s_time_t, nr_cpus); + + if ( !sumw || !sumt ) + { + xfree(sumt); + xfree(sumw); + return -ENOMEM; + } + memset(sumw, 0, nr_cpus * sizeof(*sumw)); + memset(sumt, 0, nr_cpus * sizeof(*sumt)); /* Sum across all weights. */ rcu_read_lock(&domlist_read_lock); @@ -1348,6 +1358,9 @@ static int sedf_adjust_weights(struct xen_domctl_scheduler_op *cmd) } rcu_read_unlock(&domlist_read_lock); + xfree(sumt); + xfree(sumw); + return 0; } @@ -1356,6 +1369,7 @@ static int sedf_adjust_weights(struct xen_domctl_scheduler_op *cmd) static int sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op) { struct vcpu *v; + int rc; PRINT(2,"sedf_adjust was called, domain-id %i new period %"PRIu64" " "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n", @@ -1411,8 +1425,9 @@ static int sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op) } } - if ( sedf_adjust_weights(op) ) - return -EINVAL; + rc = sedf_adjust_weights(op); + if ( rc ) + return rc; for_each_vcpu ( p, v ) { |