From: Dario Faggioli Date: Wed, 15 Feb 2017 15:47:29 +0000 (+0000) Subject: xen: credit2: clear bit instead of skip step in runq_tickle() X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2785 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e58b6d95e8cff2db1fd3545eb43a50362b2fb65a;p=xen.git xen: credit2: clear bit instead of skip step in runq_tickle() Since we are doing cpumask manipulation already, clear a bit in the mask at once. Doing that will save us an if, later in the code. No functional change intended. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 741d372dac..920a7cef95 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -991,7 +991,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) cpumask_andnot(&mask, &rqd->active, &rqd->idle); cpumask_andnot(&mask, &mask, &rqd->tickled); cpumask_and(&mask, &mask, cpumask_scratch_cpu(cpu)); - if ( cpumask_test_cpu(cpu, &mask) ) + if ( __cpumask_test_and_clear_cpu(cpu, &mask) ) { cur = CSCHED2_VCPU(curr_on_cpu(cpu)); burn_credits(rqd, cur, now); @@ -1007,8 +1007,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) for_each_cpu(i, &mask) { /* Already looked at this one above */ - if ( i == cpu ) - continue; + ASSERT(i != cpu); cur = CSCHED2_VCPU(curr_on_cpu(i));