[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [PATCH MINI-OS v3 2/2] xenbus: workaround oxenstored short-write



On Tue, 2015-10-27 at 16:47 +0100, Samuel Thibault wrote:
> Wei Liu, le Tue 27 Oct 2015 15:43:29 +0000, a Ãcrit :
> > Oxenstored has a behaviour that it only writes a contiguous piece of
> > data. When it writes across ring boundary it will return a short-write
> > while there is still room. That leads to mini-os stalling when it sees
> > there is not enough data in the ring.
> > 
> > Given that oxenstored is the default xenstored implementation we think
> > it would be useful to workaround this for the benefit of running mini-
> > os
> > (and unikernel based on it) on any Xen installation.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> 
> As discussed in the previous thread, this is rather a workaround.

Given that I'm in the process of applying "tools/ocaml/xb: Correct
calculations of data/space the ring" which I think is the real fix here am
unsure if we still want to take this workaround.

Any thoughts?


>  Better
> be safe than sorry.
> 
> Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
> 
> And could too be backported to stable branches.
> 
> > ---
> > Âxenbus/xenbus.c | 10 ++++++++--
> > Â1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c
> > index 0ab387a..abf8b1b 100644
> > --- a/xenbus/xenbus.c
> > +++ b/xenbus/xenbus.c
> > @@ -205,8 +205,11 @@ static void xenbus_thread_func(void *ign)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂprod = xenstore_buf->rsp_prod;
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂDEBUG("Rsp_cons %d, rsp_prod %d.\n", xenstore_buf-
> > >rsp_cons,
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂxenstore_buf->rsp_prod);
> > -ÂÂÂÂÂÂÂÂÂÂÂÂif (xenstore_buf->rsp_prod - xenstore_buf->rsp_cons <
> > sizeof(msg))
> > +ÂÂÂÂÂÂÂÂÂÂÂÂif (xenstore_buf->rsp_prod - xenstore_buf->rsp_cons <
> > sizeof(msg)) {
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ/* Work around oxenstored bug */
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnotify_remote_via_evtchn(start_info.store_evtchn);
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> > +ÂÂÂÂÂÂÂÂÂÂÂÂ}
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂrmb();
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂmemcpy_from_ring(xenstore_buf->rsp,
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ&msg,
> > @@ -217,8 +220,11 @@ static void xenbus_thread_func(void *ign)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂxenstore_buf->rsp_prod - xenstore_buf->rsp_cons,
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmsg.req_id);
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂif (xenstore_buf->rsp_prod - xenstore_buf->rsp_cons <
> > -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsizeof(msg) + msg.len)
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsizeof(msg) + msg.len) {
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ/* Work around oxenstored bug */
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂnotify_remote_via_evtchn(start_info.store_evtchn);
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> > +ÂÂÂÂÂÂÂÂÂÂÂÂ}
> > Â
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂDEBUG("Message is good.\n");
> > Â
> > -- 
> > 2.1.4
> > 
> 
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.