All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Cc: Kamala Narasimhan <kamala.narasimhan@gmail.com>,
	Christoph Egger <Christoph.Egger@amd.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Gianni Tedesco <gianni.tedesco@citrix.com>
Subject: Re: libxl: error handling before xenstored runs
Date: Fri, 11 Feb 2011 08:03:23 +0000	[thread overview]
Message-ID: <1297411403.3221.1449.camel@localhost.localdomain> (raw)
In-Reply-To: <4D545EBE.1060501@eu.citrix.com>

On Thu, 2011-02-10 at 21:55 +0000, Vincent Hanquez wrote: 
> On 10/02/11 11:24, Ian Campbell wrote:
> > Right but this approach doesn't work with xenstored in a stubdomain.
> 
> yeah I know. xenstored in a stubdom is just an experiment, when it 
> become a serious feature, this argument would hold. however it's not 
> going to be use in 4.1, and in any production settings.

Accepted.

As I understand it people are actively using stub-xenstored in
disaggregation research today. Reinvigorating the stub domain approach
for Xen is also (going to be) one of our GSoC proposals this year.

> > 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):
> 
> The kernel is not the one exclusively setting the rid. this is a client 
> initialized value. any xs implementation can use it any way they want 
> (including the kernel implementation).
> 
> Turns out that most of the implementations are actually putting rid to 0 
> anyway (the ocaml and C implementation are, the windows one isn't).
> 
> Even then, if you could initialize it to some value, what value is that 
> going to be ? there's just no way to know if someone else is not using 
> this rid already globally (since the ring is a global OS thing). Which 
> basically would means tracking pid (the kernel meaning) along with the rid ?

Since the kernel mediates all access to the actual ring it can handle
the req_id with a single incrementing integer and fake out whatever is
necessary to its users.

It's trivial to fixup the in-kernel xs users. Most likely it only
involves changing a single function in the core xs kernel code which
everyone else must use anyway.

For userspace users it's a little trickier but the kernel just needs to
remember the userspace supplied req_id before inserting its own and to
reverse the substitution in the reply. If you were to support multiple
outstanding active requests then it would be natural to stash the id in
whatever data structure you were using for that. If you only want to
simplify by only supporting a single active request (by throwing away
responses to aborted/timed out requests as I suggested earlier) you only
need to remember the user provided req_id for the one request which is
trivial.

AFAIK we don't have any kernel code which does clever things such as
using a pointer to a datastructure as the req_id but if we did (and we
were unwilling to simply change it) then the userspace solution would
work there too.

> >>> Maybe we should add an explicit ping/pong ring message to the xs ring
> >>> protocol?
> >>
> >> And who's going to reply to this if xenstored is missing ? you would
> >> require the kernel to introspect the messages and reply by itself.
> >
> > The reason I suggested new messages was that I would solve that by
> > declaring that these new messages have whatever magic semantics I need
> > to make this work ;-)
> 
> ah right, the famous DeusExMachina message type then :-)

:-)

Ian

  reply	other threads:[~2011-02-11  8:03 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
2011-02-10 12:42                             ` Ian Jackson
2011-02-10 21:55                       ` Vincent Hanquez
2011-02-11  8:03                         ` Ian Campbell [this message]
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=1297411403.3221.1449.camel@localhost.localdomain \
    --to=ian.campbell@eu.citrix.com \
    --cc=Christoph.Egger@amd.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.