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

Re: [Xen-devel] [Minios-devel] [PATCH MINI-OS v2] xenbus: notify the other end when necessary



On Mon, Oct 26, 2015 at 06:34:59PM +0000, Wei Liu wrote:
> On Mon, Oct 26, 2015 at 06:11:04PM +0100, Samuel Thibault wrote:
> > Wei Liu, le Mon 26 Oct 2015 16:41:15 +0000, a écrit :
> > > The oxenstored in staging.
> > 
> > Ok.  For a first, one fishy thing at quick sight is that the only
> > occurence of rsp_cons (except at closure) is when writing, and not when
> > going to sleep.  One issue there is that ml_interface_write only writes
> > a contiguous piece of data, so when crossing the ring bound, it will
> > return a short write while there *is* room!
> > 
> > One quick test you could do is calling Xs_ring.write a second time in
> > tools/ocaml/libs/xb/xb.ml's write_mmap, something like below (untested,
> > and my caml is old, so it's ugly, but you get the idea).
> > 
> > Samuel
> > 
> > diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml
> > index 50944b5..33298d2 100644
> > --- a/tools/ocaml/libs/xb/xb.ml
> > +++ b/tools/ocaml/libs/xb/xb.ml
> > @@ -91,10 +91,12 @@ let write_fd back con s len =
> >     Unix.write back.fd s 0 len
> >  
> >  let write_mmap back con s len =
> > -   let ws = Xs_ring.write back.mmap s len in
> > -   if ws > 0 then
> > +   let ws = ref (Xs_ring.write back.mmap s len) in
> > +   if !ws < len then
> > +           ws := !ws + Xs_ring.write back.mmap (String.sub s !ws 
> > (len-!ws)) (len-!ws);
> > +   if !ws > 0 then
> >             back.eventchn_notify ();
> > -   ws
> > +   !ws
> >  
> >  let write con s len =
> >     match con.backend with
> 
> I'm now running a slightly modified version of this diff (to fix
> compilation) and a mini-os only notifies the other end when it consumes
> message.
> 
> The result is looking good, but I will let it run overnight to be sure.
> 

The test ran overnight without issue.

I think it would be sensible to take my v2 patch for mini-os and work on
fixes for xenstored.

I haven't checked if cxenstored behaves the same, though.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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