[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 4/5] 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@xxxxxxxx> --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -641,7 +641,7 @@ _csched_cpu_pick(const struct scheduler 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_privat 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 { /* Attachment:
credit-replace-cpumask_empty.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |