diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-08-23 15:06:21 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-08-23 15:06:21 +0200 |
commit | b845268509f30a4f4e8e5ca9e7d323f468d21044 (patch) | |
tree | 2c30a70d72947706650f2d8a551edcf78fe8d5eb /xen/common/sched_credit.c | |
parent | a6aed7607de96904a96b8800b454511cf8334979 (diff) | |
download | xen-b845268509f30a4f4e8e5ca9e7d323f468d21044.tar.gz xen-b845268509f30a4f4e8e5ca9e7d323f468d21044.tar.bz2 xen-b845268509f30a4f4e8e5ca9e7d323f468d21044.zip |
credit1: replace cpumask_empty() uses
In one case it was redundant with the operation it got combined with,
and in the other it could easily be replaced by range checking the
result of a subsequent operation. (When running on big systems,
operations on CPU masks aren't cheap enough to use them carelessly.)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/common/sched_credit.c')
-rw-r--r-- | xen/common/sched_credit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 318831054d..0b816629e6 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -641,7 +641,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit) cpu = cpumask_test_cpu(vc->processor, &cpus) ? vc->processor : cpumask_cycle(vc->processor, &cpus); - ASSERT( !cpumask_empty(&cpus) && cpumask_test_cpu(cpu, &cpus) ); + ASSERT(cpumask_test_cpu(cpu, &cpus)); /* * Try to find an idle processor within the above constraints. @@ -1520,10 +1520,9 @@ csched_load_balance(struct csched_private *prv, int cpu, cpumask_and(&workers, &workers, &node_to_cpumask(peer_node)); cpumask_clear_cpu(cpu, &workers); - if ( cpumask_empty(&workers) ) - goto next_node; - peer_cpu = cpumask_first(&workers); + if ( peer_cpu >= nr_cpu_ids ) + goto next_node; do { /* |