From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Gri-0005Pf-DJ for qemu-devel@nongnu.org; Mon, 12 Sep 2011 20:28:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3Grh-0008NM-3Z for qemu-devel@nongnu.org; Mon, 12 Sep 2011 20:28:42 -0400 Received: from cotton.ocn.ne.jp ([122.28.30.200]:60489 helo=smtp.cotton.ocn.ne.jp) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3Grg-0008Mj-E4 for qemu-devel@nongnu.org; Mon, 12 Sep 2011 20:28:41 -0400 Date: Tue, 13 Sep 2011 09:28:44 +0900 Message-ID: <87wrdde14z.wl%morita.kazutaka@lab.ntt.co.jp> From: MORITA Kazutaka In-Reply-To: <1315555898-16957-1-git-send-email-pbonzini@redhat.com> References: <871uvquxi0.wl%morita.kazutaka@lab.ntt.co.jp> <1315555898-16957-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, MORITA Kazutaka At Fri, 9 Sep 2011 10:11:38 +0200, Paolo Bonzini wrote: > > Outside coroutines, avoid busy waiting on EAGAIN by temporarily > making the socket blocking. > > The API of qemu_recvv/qemu_sendv is slightly different from > do_readv/do_writev because they do not handle coroutines. It > returns the number of bytes written before encountering an > EAGAIN. The specificity of yielding on EAGAIN is entirely in > qemu-coroutine.c. > > Cc: MORITA Kazutaka > Signed-off-by: Paolo Bonzini > --- > Thanks for the review. I checked with qemu-io that all of > > readv -v 0 524288 (x8) > readv -v 0 262144 (x16) > readv -v 0 1024 (x4096) > readv -v 0 1536 (x2730) 1024 > readv -v 0 1024 512 (x2730) 1024 > > work and produce the same output, while previously they would fail. > Looks like it's hard to trigger the code just with qemu. > > block/sheepdog.c | 225 ++++++------------------------------------------------ > cutils.c | 103 +++++++++++++++++++++++++ > qemu-common.h | 3 + > qemu-coroutine.c | 70 +++++++++++++++++ > qemu-coroutine.h | 26 ++++++ > 5 files changed, 225 insertions(+), 202 deletions(-) Thanks, this passed qemu-iotests on Sheepdog. Reviewed-by: MORITA Kazutaka