From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 1/5] xen: use masking operation instead of test_bit for RTDS bits Date: Mon, 5 Oct 2015 14:30:26 +0100 Message-ID: <56127B72.3020501@citrix.com> References: <1443760830-29095-1-git-send-email-jgross@suse.com> <1443760830-29095-2-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443760830-29095-2-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross , keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, george.dunlap@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 02/10/15 05:40, Juergen Gross wrote: > 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 Acked-by: George Dunlap > --- > xen/common/sched_rt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c > index 4b5c5e4..6a341b1 100644 > --- a/xen/common/sched_rt.c > +++ b/xen/common/sched_rt.c > @@ -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; >