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

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


  • To: Daniel Davis <daniel.davis@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Fri, 19 Jul 2019 09:02:17 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Paul.Durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Daniel Davis <daniel.davis@xxxxxxxxxx>
  • Delivery-date: Fri, 19 Jul 2019 09:02:46 +0000
  • Ironport-sdr: y4X2PXHnwPM8OSn+JKm/ELt/mSjcn6zayDrznhaaZfi4bnfu39MsISed0f7SrcpYat5ABPv8kW esjaDZX2c+2YYn/z3FgpSmeK8/vckCrcQFIQxUnBRXCjmPesV3iiLiYzrIaN4smTLUeA/UQZaz WNZcFozIEtmWlIScS/LziL4iriUWcGP0dHdPu55zZYoeSVNFas0hS0r1ijO7boZxxUuJHft8o2 SaTV1N+1IWuskPwxprnR0/hNDoicmGWbdspZp7MpVfLVYRJXHxUE9Pntb4CaxIR5abTGQcKIkI mZw=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Thread-index: AQHVPWGHsBVQiP9OyE+fccSkYZnIxabRn7DA
  • Thread-topic: [win-pv-devel] [PATCH v2] rate limit BLKIF_OP failure log messages

> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of 
> Daniel Davis
> Sent: 18 July 2019 13:08
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Daniel Davis <daniel.davis@xxxxxxxxxx>
> Subject: [win-pv-devel] [PATCH v2] rate limit BLKIF_OP failure log messages
> 
> Signed-off-by: Daniel Davis <Daniel.Davis@xxxxxxxxxx>

Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

..with one nit...

> ---
>  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) {

You don't need both the cast and 'ull'. I can drop the cast on commit though.

> +            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
_______________________________________________
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®.