From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] evtchn/fifo: don't corrupt queues if an old tail is linked
Date: Mon, 9 Dec 2013 11:49:38 +0000 [thread overview]
Message-ID: <52A5AE52.8020601@citrix.com> (raw)
In-Reply-To: <52A59C43020000780010B473@nat28.tlf.novell.com>
On 09/12/13 09:32, Jan Beulich wrote:
>>>> On 06.12.13 at 18:38, David Vrabel <david.vrabel@citrix.com> wrote:
>> --- a/xen/include/xen/sched.h
>> +++ b/xen/include/xen/sched.h
>> @@ -98,6 +98,8 @@ struct evtchn
>> } u;
>> u8 priority;
>> u8 pending:1;
>> + u16 last_vcpu_id;
>> + u8 last_priority;
>
> Is it really correct for these two new fields to remain uninitialized
> until evtchn_fifo_set_pending() would get run the first time (and
> hence thinking there was a move this first time through)?
They're initialized to zero and I think this is fine. The code as-is is
simpler than having to special case events that have never been on a queue.
> Which also gets me to ask whether it's really correct to only set
> the priority to EVTCHN_FIFO_PRIORITY_DEFAULT in setup_ports(),
> but not on any subsequently allocated/bound ones?
This patch fixes this but would you prefer a new evtchn_port_op hook for
the init?
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -141,6 +141,7 @@ static struct evtchn *alloc_evtchn_bucket(struct
domain *d, unsigned int port)
return NULL;
}
chn[i].port = port + i;
+ chn[i].priority = EVTCHN_FIFO_PRIORITY_DEFAULT;
}
return chn;
}
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index b29297f..394879e 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -444,7 +444,6 @@ static void setup_ports(struct domain *d)
* For each port that is already bound:
*
* - save its pending state.
- * - set default priority.
*/
for ( port = 1; port < d->max_evtchns; port++ )
{
@@ -457,8 +456,6 @@ static void setup_ports(struct domain *d)
if ( test_bit(port, &shared_info(d, evtchn_pending)) )
evtchn->pending = 1;
-
- evtchn_fifo_set_priority(d, evtchn, EVTCHN_FIFO_PRIORITY_DEFAULT);
}
}
David
next prev parent reply other threads:[~2013-12-09 11:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 17:38 [PATCHv6 0/1] Xen: FIFO-based event channel fix David Vrabel
2013-12-06 17:38 ` [PATCH] evtchn/fifo: don't corrupt queues if an old tail is linked David Vrabel
2013-12-09 9:32 ` Jan Beulich
2013-12-09 11:49 ` David Vrabel [this message]
2013-12-09 12:21 ` Jan Beulich
2013-12-09 12:56 ` David Vrabel
2013-12-09 13:10 ` Jan Beulich
2013-12-09 14:43 ` David Vrabel
2013-12-09 15:29 ` 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=52A5AE52.8020601@citrix.com \
--to=david.vrabel@citrix.com \
--cc=JBeulich@suse.com \
--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.