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-changelog

[Xen-changelog] [xen-unstable] stubdom: optimize block io completion pol

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] stubdom: optimize block io completion polling by not polling all the
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Feb 2008 06:00:09 -0800
Delivery-date: Mon, 18 Feb 2008 06:00:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202980994 0
# Node ID c1003b9e0bb8a32ab61f82026aa4c9284d81ece5
# Parent  b9b6caf06f8c355fcc79a1cd9bfff883167751b8
stubdom: optimize block io completion polling by not polling all the
time; only when some requests have completed.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 extras/mini-os/blkfront.c |    5 +++++
 tools/ioemu/block-vbd.c   |   10 +++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff -r b9b6caf06f8c -r c1003b9e0bb8 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Thu Feb 14 09:22:33 2008 +0000
+++ b/extras/mini-os/blkfront.c Thu Feb 14 09:23:14 2008 +0000
@@ -327,6 +327,11 @@ int blkfront_aio_poll(struct blkfront_de
     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;
diff -r b9b6caf06f8c -r c1003b9e0bb8 tools/ioemu/block-vbd.c
--- a/tools/ioemu/block-vbd.c   Thu Feb 14 09:22:33 2008 +0000
+++ b/tools/ioemu/block-vbd.c   Thu Feb 14 09:23:14 2008 +0000
@@ -67,6 +67,12 @@ static int vbd_probe(const uint8_t *buf,
     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 @@ static int vbd_open(BlockDriverState *bs
     }
 
     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_init(void)
 
 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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] stubdom: optimize block io completion polling by not polling all the, Xen patchbot-unstable <=