From: Christoph Egger <Christoph.Egger@amd.com>
To: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: Kamala Narasimhan <kamala.narasimhan@gmail.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>,
Gianni Tedesco <gianni.tedesco@citrix.com>
Subject: Re: libxl: error handling before xenstored runs
Date: Thu, 10 Feb 2011 13:23:44 +0100 [thread overview]
Message-ID: <201102101323.44926.Christoph.Egger@amd.com> (raw)
In-Reply-To: <1297338227.20491.170.camel@zakaz.uk.xensource.com>
On Thursday 10 February 2011 12:43:47 Ian Campbell wrote:
> On Thu, 2011-02-10 at 11:32 +0000, Christoph Egger wrote:
> > On Thursday 10 February 2011 12:24:41 Ian Campbell wrote:
> > > On Thu, 2011-02-10 at 09:26 +0000, Vincent Hanquez wrote:
> > > > On 10/02/11 08:55, Ian Campbell wrote:
> > > > > That's the underlying bug which the heuristic is trying to avoid...
> > > > >
> > > > > Fundamentally the xs ring protocol is missing any way to tell if
> > > > > someone is listening on the other end so you have no choice but to
> > > > > try communicating and see if anyone responds.
> > > > >
> > > > > It's a pretty straightforward bug that the kernel does the waiting
> > > > > to see if anyone responds bit with an uninterruptible sleep. I took
> > > > > a quick look a little while ago but unfortunately it didn't look
> > > > > straightforward to fix on the kernel side :-( I can't remember why
> > > > > though.
> > > >
> > > > For starter, the protocol requires the messages to sit on the ring
> > > > for a underdetermined amount of time (boot watches).
> > > >
> > > > > It might be simpler to support allowing the userspace client to
> > > > > explicitly specify a timeout. I'm not sure what the impact on the
> > > > > ring is of leaving unconsumed requests on the ring when the other
> > > > > end does show up. Presumably the kernel driver just needs to be
> > > > > prepared to swallow responses whose target has given up and gone
> > > > > home.
> > > >
> > > > No, the simplest thing to do is to use the socket connection
> > > > exclusively. Just how we're doing it in XCP and XCI.
> > >
> > > Right but this approach doesn't work with xenstored in a stubdomain.
> > > Part of the point of using the ring protocol even when this isn't the
> > > case is to help ensure that it is possible and help avoid regressions
> > > etc.
> > >
> > > > The protocol is not design to do async either, so leaving unconsumed
> > > > request, could be pretty disastrous if the other end show up.
> > > > Providing the kernel doesn't detect it (i don't think it does [1]),
> > > > it would imply spurious reply, for example the previous waiting read
> > > > on "/abc/def" could reply to a next read on "/xyz/123".
> > >
> > > The wire protocol includes a req_id which is echoed in the response
> > > which sh/could facilitate multiplexing this sort of thing. The pvops
> > > kernel currently always sets it to zero but that's just an
> > > implementation detail ;-) Currently the kernel does (roughly):
> > > take_lock
> > > write_request
> > > wait_for_reply
> > > release_lock
> > > instead it should/could be:
> > > take_lock(timeout)
> > > write_request (++req_id)
> > > while read_reply.req_id != req_id && not (timeout)
> > > wait some more
> > > release lock
> >
> > I prefer a userland solution. Fixing Linux Dom0 doesn't help NetBSD Dom0.
>
> Fixing the NetBSD dom0 does though.
>
> Seriously, if kernels are lacking in functionality needed to make the
> system work smoothly and correctly we should fix them, not just default
> to adding hacks in userspace because it seems easier in the short term.
> (Obviously if the userspace solution is the right thing to do and/or
> more correct in its own right then fine lets do that).
Does xl communicate with xenstored through a named socket ?
If yes then 'connect()' should check for ECONNREFUSED.
Christoph
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
next prev parent reply other threads:[~2011-02-10 12:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 11:13 libxl: error handling before xenstored runs Christoph Egger
2011-02-09 14:29 ` Kamala Narasimhan
2011-02-09 14:42 ` Christoph Egger
2011-02-09 14:46 ` Kamala Narasimhan
2011-02-09 15:32 ` Christoph Egger
2011-02-09 15:42 ` Kamala Narasimhan
2011-02-09 15:52 ` Christoph Egger
2011-02-09 15:54 ` Christoph Egger
2011-02-09 17:39 ` Gianni Tedesco
2011-02-10 8:55 ` Ian Campbell
2011-02-10 9:26 ` Vincent Hanquez
2011-02-10 11:24 ` Ian Campbell
2011-02-10 11:32 ` Christoph Egger
2011-02-10 11:43 ` Ian Campbell
2011-02-10 12:23 ` Christoph Egger [this message]
2011-02-10 12:42 ` Ian Jackson
2011-02-10 21:55 ` Vincent Hanquez
2011-02-11 8:03 ` Ian Campbell
2011-02-11 9:49 ` Tim Deegan
2011-02-11 11:16 ` Vincent Hanquez
2011-02-10 18:30 ` Gianni Tedesco
2011-02-10 19:33 ` Ian Jackson
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=201102101323.44926.Christoph.Egger@amd.com \
--to=christoph.egger@amd.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Vincent.Hanquez@eu.citrix.com \
--cc=gianni.tedesco@citrix.com \
--cc=kamala.narasimhan@gmail.com \
--cc=xen-devel@lists.xensource.com \
/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.