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] [linux-2.6.18-xen] blkback: Request-processing loop is u

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: Request-processing loop is unbounded and hence requires a
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Jan 2008 16:30:17 -0800
Delivery-date: Fri, 18 Jan 2008 16:31:11 -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 1200675145 0
# Node ID 77f831cbb91ddca3a7539fa9197d4abc2d2bfcf9
# Parent  4b09218e65b801e937664d2a3363ba0071e0ee66
blkback: Request-processing loop is unbounded and hence requires a
yield point. Also, bad request type is a good cause to sleep for a
short while as the frontend has probably gone mad.

Patch by Steven Smith <steven.smith@xxxxxxxxxxxxx>

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 drivers/xen/blkback/blkback.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 4b09218e65b8 -r 77f831cbb91d drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c     Fri Jan 18 16:36:01 2008 +0000
+++ b/drivers/xen/blkback/blkback.c     Fri Jan 18 16:52:25 2008 +0000
@@ -38,6 +38,7 @@
 #include <linux/spinlock.h>
 #include <linux/kthread.h>
 #include <linux/list.h>
+#include <linux/delay.h>
 #include <xen/balloon.h>
 #include <asm/hypervisor.h>
 #include "common.h"
@@ -351,6 +352,9 @@ static int do_block_io_op(blkif_t *blkif
                        dispatch_rw_block_io(blkif, &req, pending_req);
                        break;
                default:
+                       /* A good sign something is wrong: sleep for a while to
+                        * avoid excessive CPU consumption by a bad guest. */
+                       mdelay(1);
                        DPRINTK("error: unknown block io operation [%d]\n",
                                req.operation);
                        make_response(blkif, req.id, req.operation,
@@ -358,7 +362,11 @@ static int do_block_io_op(blkif_t *blkif
                        free_req(pending_req);
                        break;
                }
-       }
+
+               /* Yield point for this unbounded loop. */
+               cond_resched();
+       }
+
        return more_to_do;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] blkback: Request-processing loop is unbounded and hence requires a, Xen patchbot-linux-2.6.18-xen <=