[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH v2] rate limit BLKIF_OP failure log messages
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |