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

[win-pv-devel] [PATCH v2] rate limit BLKIF_OP failure log messages


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Daniel Davis <Daniel.Davis@xxxxxxxxxx>
  • Date: Thu, 18 Jul 2019 13:08:02 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Daniel.Davis@xxxxxxxxxx; spf=Pass smtp.mailfrom=daniel.davis@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Daniel Davis <Daniel.Davis@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Jul 2019 12:08:18 +0000
  • Ironport-sdr: k9a8M4IiIgaGaA/G6ri4LuOUFOoPN/y2ND6DVBdHsU1KXe1zRu8P8QkpfDd/Ugo5kU7qYWKP2o 5KKVQAJefp5H9S0RWlKIu6tEYhpbuAVcAP9ZdRYGFYUo5x3RABz900rhe+QH2vAbloL9YE5uWT X33FL/x9TM01Y7SZ/7Bkj5wWR6HQBKCfopUdg2x6Mqfx8TekTEaCi593AM+g8NELzmX2HuhYlC w694wphOtISVOvGpgF7zDboeZNX3zvIG14Lk47Txv6yqUdSmHvT0VfHsiS2ct1Afgz+y92AP28 YRk=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Signed-off-by: Daniel Davis <Daniel.Davis@xxxxxxxxxx>
---
 src/xenvbd/ring.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 93fd920..10d4b91 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -94,6 +94,7 @@ typedef struct _XENVBD_BLKIF_RING {
     ULONG                           RequestsPushed;
     ULONG                           ResponsesProcessed;
     PXENBUS_DEBUG_CALLBACK          DebugCallback;
+    LARGE_INTEGER                   TimeOfLastErrorLog;    
 } XENVBD_BLKIF_RING, *PXENVBD_BLKIF_RING;
 
 typedef enum _XENVBD_STAT {
@@ -1212,13 +1213,22 @@ __BlkifRingCompleteResponse(
         break;
 
     case BLKIF_RSP_ERROR:
-    default:
-        Warning("Target[%u][%u] : %s BLKIF_RSP_ERROR\n",
-                FrontendGetTargetId(Frontend),
-                BlkifRing->Index,
-                __BlkifOperationName(Request->Operation));
+    default: {
+        LARGE_INTEGER TimeNow;
+
+        KeQuerySystemTime(&TimeNow);
+
+        // If last log message was more than 10 seconds ago
+        if (TimeNow.QuadPart - BlkifRing->TimeOfLastErrorLog.QuadPart > 
(ULONGLONG) 100000000ull) {
+            Warning("Target[%u][%u] : %s BLKIF_RSP_ERROR\n",
+                    FrontendGetTargetId(Frontend),
+                    BlkifRing->Index,
+                    __BlkifOperationName(Request->Operation));
+            KeQuerySystemTime(&BlkifRing->TimeOfLastErrorLog);
+        }
         Srb->SrbStatus = SRB_STATUS_ERROR;
         break;
+        }
     }
 
     BlkifRingPutRequest(BlkifRing, Request);
-- 
2.22.0.windows.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.