Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-11-02 Thread Andrew Cooper
On 02/11/15 14:24, Ian Campbell wrote: > On Mon, 2015-11-02 at 14:10 +, Andrew Cooper wrote: >> On 02/11/15 13:44, Ian Campbell wrote: >>> On Tue, 2015-10-27 at 17:10 +, Wei Liu wrote: When oxenstored wrote to the ring, it wrote a chunk of contiguous data. Originally when it

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-11-02 Thread Ian Campbell
On Mon, 2015-11-02 at 14:10 +, Andrew Cooper wrote: > On 02/11/15 13:44, Ian Campbell wrote: > > On Tue, 2015-10-27 at 17:10 +, Wei Liu wrote: > > > When oxenstored wrote to the ring, it wrote a chunk of contiguous > > > data. > > > Originally when it tried to write across ring boundary, it

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-11-02 Thread Andrew Cooper
On 02/11/15 13:44, Ian Campbell wrote: > On Tue, 2015-10-27 at 17:10 +, Wei Liu wrote: >> When oxenstored wrote to the ring, it wrote a chunk of contiguous data. >> Originally when it tried to write across ring boundary, it returned a >> short-write when there is still room. That led to stalli

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-11-02 Thread Ian Campbell
On Tue, 2015-10-27 at 17:10 +, Wei Liu wrote: > When oxenstored wrote to the ring, it wrote a chunk of contiguous data. > Originally when it tried to write across ring boundary, it returned a > short-write when there is still room. That led to stalling mini-os's > xenstore thread at times. Wh

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-28 Thread David Vrabel
On 27/10/15 17:10, Wei Liu wrote: > When oxenstored wrote to the ring, it wrote a chunk of contiguous data. > Originally when it tried to write across ring boundary, it returned a > short-write when there is still room. That led to stalling mini-os's > xenstore thread at times. > > Fix this by ca

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-28 Thread Andrew Cooper
On 28/10/15 13:34, David Scott wrote: > >> On 27 Oct 2015, at 17:31, Andrew Cooper wrote: >> >> On 27/10/15 17:28, Samuel Thibault wrote: >>> Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +, a écrit : as the second attempted write could return short as well. >>> That is fine. The second atte

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-28 Thread Samuel Thibault
David Scott, le Wed 28 Oct 2015 13:34:10 +, a écrit : > However I believe the ‘suspicious’ OCaml patch fixes the specific issue (— or > have I missed something?). It does. > Does anyone have time to prototype what a C-level fix would look like? Here is a try, untested though. Signed-off-by

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-28 Thread David Scott
> On 27 Oct 2015, at 17:31, Andrew Cooper wrote: > > On 27/10/15 17:28, Samuel Thibault wrote: >> Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +, a écrit : >>> as the second attempted write could return short as well. >> That is fine. The second attempt will only return a short write if there

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Samuel Thibault
Another way would be to make ml_interface_write write both pieces instead of just a contiguous one. The caml code would then look less suspicious :) Samuel ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Andrew Cooper
On 27/10/15 17:28, Samuel Thibault wrote: > Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +, a écrit : >> as the second attempted write could return short as well. > That is fine. The second attempt will only return a short write if there > was really not enough room for it, which is what we want.

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Samuel Thibault
Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +, a écrit : > as the second attempted write could return short as well. That is fine. The second attempt will only return a short write if there was really not enough room for it, which is what we want. Samuel __

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Samuel Thibault
Andrew Cooper, le Tue 27 Oct 2015 17:21:39 +, a écrit : > The correct behaviour would be for Xs_ring.write to return the actual > number of bytes it put into the ring, even if this is shorter than len. That is already what it does. Samuel ___ Xen-d

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Samuel Thibault
That being said, Wei Liu, le Tue 27 Oct 2015 17:10:09 +, a écrit : > @@ -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_rin

Re: [Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Andrew Cooper
On 27/10/15 17:10, Wei Liu wrote: > When oxenstored wrote to the ring, it wrote a chunk of contiguous data. > Originally when it tried to write across ring boundary, it returned a > short-write when there is still room. That led to stalling mini-os's > xenstore thread at times. > > Fix this by cal

[Xen-devel] [PATCH] oxenstored: fix short-write issue

2015-10-27 Thread Wei Liu
When oxenstored wrote to the ring, it wrote a chunk of contiguous data. Originally when it tried to write across ring boundary, it returned a short-write when there is still room. That led to stalling mini-os's xenstore thread at times. Fix this by calling write function for a second time when th