From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: christoffer.dall@linaro.org, xen-devel@lists.xenproject.org,
tim@xen.org, parth.dixit@linaro.org,
stefano.stabellini@citrix.com
Subject: Re: [PATCH v3 1/2] xen/arm: vgic: Keep track of vIRQ used by a domain
Date: Wed, 18 Feb 2015 17:36:35 +0000 [thread overview]
Message-ID: <54E4CDA3.1020506@linaro.org> (raw)
In-Reply-To: <1422889793.4801.13.camel@citrix.com>
Hi Ian,
On 02/02/2015 15:09, Ian Campbell wrote:
> On Thu, 2015-01-29 at 15:51 +0000, Julien Grall wrote:
>> - Move the retry after looking for first/end. I keep the goto
>> rather than a loop because it's more clear that we retry because
>> we were unable to set the bit
>
> Then I think a "do {} while (!successfully allocated)" is what is
> wanted, maybe with a comment.
I though about it and I find the do {} while more difficult to read than
the goto in this specific case.
I find more explicit with the goto that we will unlikely retry.
y. Adding a comment in the code doesn't really help.
the do {} while version would look like:
do {
virq = find_next_zero_bit(d->arch.vgic.allocated_irqs, end, first);
if ( virq >= end )
return -1;
ret = test_and_set_bit(virq, d->arch.vgic.allocated_irqs);
/* There is no spinlock to protect allocated_irqs, therefore
* test_and_set_bit may unlikely fail. If so retry it.
*/
} while ( unlikely(ret) )
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-02-18 17:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 15:51 [PATCH v3 0/2] xen/arm: Automatically find a PPI for the DOM0 event IRQ Julien Grall
2015-01-29 15:51 ` [PATCH v3 1/2] xen/arm: vgic: Keep track of vIRQ used by a domain Julien Grall
2015-02-02 15:09 ` Ian Campbell
2015-02-18 17:36 ` Julien Grall [this message]
2015-02-19 17:15 ` Ian Campbell
2015-02-19 17:19 ` Julien Grall
2015-01-29 15:51 ` [PATCH v3 2/2] xen/arm: Automatically find a PPI for the DOM0 event channel interrupt Julien Grall
2015-02-02 15:12 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E4CDA3.1020506@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=christoffer.dall@linaro.org \
--cc=parth.dixit@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.