]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
use masking operation instead of test_bit for RTDS bits
authorJuergen Gross <jgross@suse.com>
Fri, 2 Oct 2015 11:43:35 +0000 (13:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 2 Oct 2015 11:43:35 +0000 (13:43 +0200)
Use a bit mask for testing of a set bit instead of test_bit in case no
atomic operation is needed, as this will lead to smaller and more
effective code.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/sched_rt.c

index 4b5c5e4c5bc9dbd7a3f3fc66c6b3dfbac3bb5da8..6a341b11f0b5ef5587caa9991d9955f4df9ba52c 100644 (file)
@@ -931,7 +931,7 @@ rt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
     else if ( __vcpu_on_q(svc) )
         __q_remove(svc);
-    else if ( test_bit(__RTDS_delayed_runq_add, &svc->flags) )
+    else if ( svc->flags & RTDS_delayed_runq_add )
         clear_bit(__RTDS_delayed_runq_add, &svc->flags);
 }
 
@@ -1064,7 +1064,7 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
      * the Runqueue/DepletedQ. Instead, we set a flag so that it will be
      * put on the Runqueue/DepletedQ after the context has been saved.
      */
-    if ( unlikely(test_bit(__RTDS_scheduled, &svc->flags)) )
+    if ( unlikely(svc->flags & RTDS_scheduled) )
     {
         set_bit(__RTDS_delayed_runq_add, &svc->flags);
         return;