WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] stubdom: optimize block io completion polling

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [PATCH] stubdom: optimize block io completion polling
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Wed, 13 Feb 2008 15:57:38 +0000
Delivery-date: Wed, 13 Feb 2008 07:58:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080213135959.GB10579@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <20080213135959.GB10579@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Samuel Thibault, le Wed 13 Feb 2008 13:59:59 +0000, a écrit :
> stubdom: optimize block io completion polling
> by not polling all the time but just when some requests have completed.

Oops, sorry, although it never happened during my tests, I'm pretty sure
there is a race, please use this patch instead:

stubdom: optimize block io completion polling
by not polling all the time but just when some requests have completed.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r e85399173769 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Tue Feb 12 16:59:08 2008 +0000
+++ b/extras/mini-os/blkfront.c Wed Feb 13 15:55:47 2008 +0000
@@ -327,6 +327,11 @@
     struct blkif_response *rsp;
 
 moretodo:
+#ifdef HAVE_LIBC
+    files[dev->fd].read = 0;
+    mb(); /* Make sure to let the handler set read to 1 before we start 
looking at the ring */
+#endif
+
     rp = dev->ring.sring->rsp_prod;
     rmb(); /* Ensure we see queued responses up to 'rp'. */
     cons = dev->ring.rsp_cons;
--- a/tools/ioemu/block-vbd.c   Tue Feb 12 16:59:08 2008 +0000
+++ b/tools/ioemu/block-vbd.c   Wed Feb 13 15:55:47 2008 +0000
@@ -67,6 +67,12 @@
     return 100;
 }
 
+static void vbd_io_completed(void *opaque)
+{
+    BDRVVbdState *s = opaque;
+    blkfront_aio_poll(s->dev);
+}
+
 static int vbd_open(BlockDriverState *bs, const char *filename, int flags)
 {
     BDRVVbdState *s = bs->opaque;
@@ -85,6 +91,7 @@
     }
 
     s->fd = blkfront_open(s->dev);
+    qemu_set_fd_handler(s->fd, vbd_io_completed, NULL, s);
 
     QEMU_LIST_INSERT_HEAD(&vbds, s, list);
 
@@ -102,9 +109,6 @@
 
 void qemu_aio_poll(void)
 {
-    BDRVVbdState *s;
-    for (s = vbds.lh_first; s; s = s->list.le_next)
-       blkfront_aio_poll(s->dev);
 }
 
 /* Wait for all IO requests to complete.  */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>