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

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

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).


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

Minios-devel mailing list



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