Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen Add more ratechecks to avoid console spam w...



details:   https://anonhg.NetBSD.org/src/rev/b448cd119a0e
branches:  trunk
changeset: 780420:b448cd119a0e
user:      jym <jym%NetBSD.org@localhost>
date:      Mon Jul 23 01:31:01 2012 +0000

description:
Add more ratechecks to avoid console spam when the backend gets a
stream of errors.

Remove the unused xbdi_errps (error per second) variable. Errors should
rather be tracked in absolute, with a threshold that forces a time penalty
to the xbdback thread when frontend goes nuts.

diffstat:

 sys/arch/xen/xen/xbdback_xenbus.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (51 lines):

diff -r 115612b09713 -r b448cd119a0e sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Mon Jul 23 00:49:20 2012 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Mon Jul 23 01:31:01 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.56 2012/05/23 10:01:51 cegger Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.57 2012/07/23 01:31:01 jym Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.56 2012/05/23 10:01:51 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.57 2012/07/23 01:31:01 jym Exp $");
 
 #include <sys/atomic.h>
 #include <sys/buf.h>
@@ -198,7 +198,6 @@
        /* other state */
        int xbdi_same_page; /* are we merging two segments on the same page? */
        uint xbdi_pendingreqs; /* number of I/O in fly */
-       int xbdi_errps; /* errors per second */
        struct timeval xbdi_lasterr_time;    /* error time tracking */
 #ifdef DEBUG
        struct timeval xbdi_lastfragio_time; /* fragmented I/O tracking */
@@ -1460,8 +1459,11 @@
        seg_size = this_ls - this_fs + 1;
 
        if (seg_size < 0) {
-               printf("xbdback_io domain %d: negative-size request (%d %d)\n",
-                      xbdi->xbdi_domid, this_ls, this_fs);
+               if (ratecheck(&xbdi->xbdi_lasterr_time, &xbdback_err_intvl)) {
+                       printf("xbdback_io domain %d: negative-size request "
+                           "(%d %d)\n",
+                           xbdi->xbdi_domid, this_ls, this_fs);
+               }
                xbdback_io_error(xbdi->xbdi_io, EINVAL);
                xbdi->xbdi_io = NULL;
                xbdi->xbdi_cont = xbdback_co_main_incr;
@@ -1775,7 +1777,9 @@
                xbdi->xbdi_cont = xbdback_co_wait_shm_callback;
                return NULL;
        default:
-               printf("xbdback_map_shm: xen_shm error %d ", error);
+               if (ratecheck(&xbdi->xbdi_lasterr_time, &xbdback_err_intvl)) {
+                       printf("xbdback_map_shm: xen_shm error %d ", error);
+               }
                xbdback_io_error(xbdi->xbdi_io, error);
                xbdi->xbdi_io = NULL;
                xbdi->xbdi_cont = xbdi->xbdi_cont_aux;



Home | Main Index | Thread Index | Old Index