From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 2/4] xen/events: document behaviour when scanning the start word for events
Date: Thu, 15 Aug 2013 10:10:15 -0400 [thread overview]
Message-ID: <520CE147.40209@oracle.com> (raw)
In-Reply-To: <1376569267-11653-3-git-send-email-david.vrabel@citrix.com>
On 08/15/2013 08:21 AM, David Vrabel wrote:
> From: David Vrabel <david.vrabel@citrix.com>
>
> The original comment on the scanning of the start word on the 2nd pass
> did not reflect the actual behaviour (the code was incorrectly masking
> bit_idx instead of the pending word itself).
>
> The documented behaviour is not actually required since if event were
> pending in the MSBs, they would be immediately scanned anyway as we go
> through the loop again.
>
> Update the documentation to reflect this (instead of trying to change
> the behaviour).
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> drivers/xen/events.c | 17 ++++++++++++-----
> 1 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index a58ac43..f866f50 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -1379,14 +1379,21 @@ static void __xen_evtchn_do_upcall(void)
>
> pending_bits = active_evtchns(cpu, s, word_idx);
> bit_idx = 0; /* usually scan entire word from start */
> + /*
> + * We scan the starting word in two parts.
> + *
> + * 1st time: start in the middle, scanning the
> + * MSBs.
I think MSB stands for most significant *byte*. 'msb' is for *bit*. Or
just say
'upper bits'.
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> + *
> + * 2nd time: scan the whole word (not just the
> + * parts skipped in the first pass) -- if an
> + * event in the previously scanned bits is
> + * pending again it would just be scanned on
> + * the next loop anyway.
> + */
> if (word_idx == start_word_idx) {
> - /* We scan the starting word in two parts */
> if (i == 0)
> - /* 1st time: start in the middle */
> bit_idx = start_bit_idx;
> - else
> - /* 2nd time: mask bits done already */
> - bit_idx &= (1UL << start_bit_idx) - 1;
> }
>
> do {
next prev parent reply other threads:[~2013-08-15 14:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 12:21 [PATCHv2 0/4] Linux: fix some (more) event handling bugs David Vrabel
2013-08-15 12:21 ` [PATCH 1/4] x86/xen: disable premption when enabling local irqs David Vrabel
2013-08-15 12:21 ` [PATCH 2/4] xen/events: document behaviour when scanning the start word for events David Vrabel
2013-08-15 14:10 ` Boris Ostrovsky [this message]
2013-08-15 12:21 ` [PATCH 3/4] xen/events: initialize local per-cpu mask for all possible events David Vrabel
2013-08-15 12:44 ` Jan Beulich
2013-08-15 12:49 ` David Vrabel
2013-08-15 13:06 ` Jan Beulich
2013-08-19 17:10 ` David Vrabel
2013-08-15 12:21 ` [PATCH 4/4] xen/events: mask events when changing their VCPU binding David Vrabel
2013-08-15 12:48 ` Jan Beulich
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=520CE147.40209@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).