From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH MINI-OS v3 2/2] xenbus: workaround oxenstored short-write Date: Tue, 27 Oct 2015 16:47:40 +0100 Message-ID: <20151027154740.GF2483@var.bordeaux.inria.fr> References: <1445960609-16977-1-git-send-email-wei.liu2@citrix.com> <1445960609-16977-3-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1445960609-16977-3-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: minios-devel@lists.xenproject.org, Xen-devel , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Wei Liu, le Tue 27 Oct 2015 15:43:29 +0000, a =E9crit : > 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 As discussed in the previous thread, this is rather a workaround. Better be safe than sorry. Acked-by: Samuel Thibault 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 =3D 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 > = -- = Samuel "c'est pas nous qui sommes =E0 la rue, c'est la rue qui est =E0 nous"