[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 1/2] rate limit BLKIF_OP failure log messages XSI-413
Signed-off-by Daniel Davis <daniel.davis@xxxxxxxxxx> --- src/xenvbd/ring.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c index 93fd920..431e1b5 100644 --- a/src/xenvbd/ring.c +++ b/src/xenvbd/ring.c @@ -52,6 +52,7 @@ #include "debug.h" #include "assert.h" + #define XENVBD_MAX_RING_PAGE_ORDER (4) #define XENVBD_MAX_RING_PAGES (1 << XENVBD_MAX_RING_PAGE_ORDER) @@ -94,6 +95,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 { @@ -1213,12 +1215,22 @@ __BlkifRingCompleteResponse( case BLKIF_RSP_ERROR: default: - Warning("Target[%u][%u] : %s BLKIF_RSP_ERROR\n", - FrontendGetTargetId(Frontend), - BlkifRing->Index, - __BlkifOperationName(Request->Operation)); - Srb->SrbStatus = SRB_STATUS_ERROR; - break; + { + LARGE_INTEGER timeNow; + + KeQuerySystemTime(&timeNow); + + //if last log message was less than 10 seconds ago + if (timeNow.QuadPart - BlkifRing->TimeOfLastErrorLog.QuadPart < 100000000) { + 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); @@ -1229,6 +1241,7 @@ __BlkifRingCompleteResponse( } } + static FORCEINLINE BOOLEAN BlkifRingPoll( IN PXENVBD_BLKIF_RING BlkifRing -- 2.22.0.windows.1 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |