From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Andres Lagar Cavilla <andres@lagarcavilla.org>,
"Aravindh Puthiyaparambil (aravindp)" <aravindp@cisco.com>
Cc: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 2/2] Xen/mem_event: Prevent underflow of vcpu pause counts
Date: Thu, 17 Jul 2014 20:07:45 +0100 [thread overview]
Message-ID: <53C81F01.4040105@citrix.com> (raw)
In-Reply-To: <CADzFZPu4=R0nxPFeXeROX=-rAm8j-51JgPg_NDnbbkEfWV4d8Q@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1593 bytes --]
On 17/07/14 19:54, Andres Lagar Cavilla wrote:
> On Thu, Jul 17, 2014 at 2:51 PM, Aravindh Puthiyaparambil (aravindp)
> <aravindp@cisco.com <mailto:aravindp@cisco.com>> wrote:
>
> >> +void mem_event_vcpu_unpause(struct vcpu *v) {
> >> + if ( test_and_clear_bool(v->paused_for_mem_event) )
> >
> >And now that we consider more than one mem event piling up to pause a
> >vcpu, this has to become an atomic counter, which unpauses on
> zero, and
> >takes care of underflow.
>
> Very true. I have seen this event pile up occur in practice in our
> product.
>
> The problem becomes how to tell apart real event responses that should
> dec the pause count from spurious crap from the toolstack. IOW, how to
> not unpause the vcpu when count reaches zero due to bad responses. I
> think the answer is: you can't, if the toolstack is evil, behavior
> undefined and bigger fish to fry.
>
> Andres
You really can't, but the important bit is to ensure that Xen is
sufficiently insulated from buggy toolstack components that it doesn't
fall over.
>From my experimenting with the pausedomain refcoutnging, weird stuff
happens when the domain pause count turns negative. I ended up with a
domain which would never be scheduled again (even after returning the
count to positive and back to 0), and a domain which couldn't be killed
using `xl destroy`. Rebooting was the only option.
So long as Xen doesn't fall into these problems, a buggy toolstack
(especially with mem_events) already has many ways to screw over a
domain, so one more is not a problem.
~Andrew
[-- Attachment #1.2: Type: text/html, Size: 2946 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-07-17 19:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 13:10 [PATCH 0/2] Xen/mem_event: Do not rely on the toolstack being bug-free Andrew Cooper
2014-07-17 13:10 ` [PATCH 1/2] Xen/mem_event: Validate the response vcpu_id before acting on it Andrew Cooper
2014-07-17 18:33 ` Andres Lagar Cavilla
2014-07-17 13:10 ` [PATCH 2/2] Xen/mem_event: Prevent underflow of vcpu pause counts Andrew Cooper
2014-07-17 18:38 ` Andres Lagar Cavilla
[not found] ` <CAGU+auv8zMj+xqU8KhbQSZXM+J+HovjV=TZMab5Z+nzNCvpjaQ@mail.gmail.com>
2014-07-17 18:51 ` Aravindh Puthiyaparambil (aravindp)
2014-07-17 18:54 ` Andres Lagar Cavilla
2014-07-17 18:57 ` Aravindh Puthiyaparambil (aravindp)
2014-07-17 19:07 ` Andrew Cooper [this message]
2014-07-17 19:18 ` Aravindh Puthiyaparambil (aravindp)
2014-07-17 18:55 ` Andrew Cooper
2014-07-18 9:42 ` Ian Campbell
2014-07-18 10:41 ` [PATCH v2 " Andrew Cooper
2014-07-18 13:47 ` Razvan Cojocaru
2014-07-18 13:53 ` [PATCH v3 " Andrew Cooper
2014-07-18 16:37 ` Andres Lagar Cavilla
2014-07-18 16:44 ` Andrew Cooper
2014-07-18 17:29 ` Aravindh Puthiyaparambil (aravindp)
2014-07-17 13:23 ` [PATCH 0/2] Xen/mem_event: Do not rely on the toolstack being bug-free Tim Deegan
2014-07-17 14:40 ` Razvan Cojocaru
2014-07-17 14:46 ` Andrew Cooper
2014-07-17 14:50 ` Razvan Cojocaru
[not found] ` <CAGU+auuzOr5HSErrxmyhtxtP74gn=0L5TAZGR8FWBF6MeGFxUA@mail.gmail.com>
2014-07-17 19:01 ` Aravindh Puthiyaparambil (aravindp)
2014-07-17 20:26 ` Razvan Cojocaru
2014-07-17 22:17 ` Tamas Lengyel
2014-07-17 22:42 ` Andrew Cooper
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=53C81F01.4040105@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=andres@lagarcavilla.org \
--cc=aravindp@cisco.com \
--cc=tim@xen.org \
--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).