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

Re: [win-pv-devel] [PATCH] Remove BlockRing.Outstanding / BlockRingAbort



> -----Original Message-----
> From: win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx [mailto:win-pv-devel-
> bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Owen Smith
> Sent: 02 December 2015 15:17
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith
> Subject: [win-pv-devel] [PATCH] Remove BlockRing.Outstanding /
> BlockRingAbort
> 
> The BlockRing Outstanding stat is duplicated by SubmittedReqs.Count.
> Remove BlockRing.Outstanding and the BlockRingAbort function as the
> stat is not useful, and can trigger ASSERTion failures when requests
> are stuck outstanding on a broken ring that is being destroyed.
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

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

I will also back-port this to 8.1.

> ---
>  src/xenvbd/blockring.c | 28 +---------------------------
>  src/xenvbd/blockring.h |  6 ------
>  src/xenvbd/pdo.c       |  4 +---
>  3 files changed, 2 insertions(+), 36 deletions(-)
> 
> diff --git a/src/xenvbd/blockring.c b/src/xenvbd/blockring.c
> index 6ca9cb2..e0275af 100644
> --- a/src/xenvbd/blockring.c
> +++ b/src/xenvbd/blockring.c
> @@ -56,7 +56,6 @@ struct _XENVBD_BLOCKRING {
>      ULONG                           DeviceId;
>      ULONG                           Order;
>      PVOID                           Grants[XENVBD_MAX_RING_PAGES];
> -    ULONG                           Outstanding;
>      ULONG                           Submitted;
>      ULONG                           Received;
>  };
> @@ -235,7 +234,6 @@ __BlockRingInsert(
>          break;
>      }
>      ++BlockRing->Submitted;
> -    ++BlockRing->Outstanding;
>  }
> 
>  NTSTATUS
> @@ -432,7 +430,6 @@ BlockRingDisconnect(
>      PXENVBD_GRANTER Granter = FrontendGetGranter(BlockRing-
> >Frontend);
> 
>      ASSERT(BlockRing->Connected == TRUE);
> -    ASSERT3U(BlockRing->Outstanding, ==, 0);
> 
>      BlockRing->Submitted = 0;
>      BlockRing->Received = 0;
> @@ -467,8 +464,7 @@ BlockRingDebugCallback(
>      PXENVBD_GRANTER Granter = FrontendGetGranter(BlockRing-
> >Frontend);
> 
>      XENBUS_DEBUG(Printf, Debug,
> -                 "BLOCKRING: Requests  : %d / %d / %d\n",
> -                 BlockRing->Outstanding,
> +                 "BLOCKRING: Requests  : %d / %d\n",
>                   BlockRing->Submitted,
>                   BlockRing->Received);
> 
> @@ -543,7 +539,6 @@ BlockRingPoll(
> 
>              if (__BlockRingPutTag(BlockRing, Response->id, &Tag)) {
>                  ++BlockRing->Received;
> -                --BlockRing->Outstanding;
>                  PdoCompleteResponse(Pdo, Tag, Response->status);
>              }
> 
> @@ -589,24 +584,3 @@ BlockRingSubmit(
> 
>      return TRUE;
>  }
> -
> -VOID
> -BlockRingAbort(
> -    IN  PXENVBD_BLOCKRING           BlockRing,
> -    IN  PXENVBD_REQUEST             Request
> -    )
> -{
> -    KIRQL               Irql;
> -
> -    UNREFERENCED_PARAMETER(Request);
> -
> -    KeAcquireSpinLock(&BlockRing->Lock, &Irql);
> -
> -    // Should check Request is present on the ring, but
> -    // the shared page(s) may not contain any valid data,
> -    // due to suspend/resume
> -    ASSERT3U(BlockRing->Outstanding, >, 0);
> -    --BlockRing->Outstanding;
> -
> -    KeReleaseSpinLock(&BlockRing->Lock, Irql);
> -}
> diff --git a/src/xenvbd/blockring.h b/src/xenvbd/blockring.h
> index 4c94b6c..1117d73 100644
> --- a/src/xenvbd/blockring.h
> +++ b/src/xenvbd/blockring.h
> @@ -94,10 +94,4 @@ BlockRingSubmit(
>      IN  PXENVBD_REQUEST             Request
>      );
> 
> -extern VOID
> -BlockRingAbort(
> -    IN  PXENVBD_BLOCKRING           BlockRing,
> -    IN  PXENVBD_REQUEST             Request
> -    );
> -
>  #endif // _XENVBD_BLOCKRING_H
> diff --git a/src/xenvbd/pdo.c b/src/xenvbd/pdo.c
> index 154dd8a..488a74b 100644
> --- a/src/xenvbd/pdo.c
> +++ b/src/xenvbd/pdo.c
> @@ -1578,8 +1578,7 @@ PdoPreResume(
>      )
>  {
>      LIST_ENTRY          List;
> -    PXENVBD_BLOCKRING   BlockRing = FrontendGetBlockRing(Pdo-
> >Frontend);
> -
> +
>      InitializeListHead(&List);
> 
>      // pop all submitted requests, cleanup and add associated SRB to a list
> @@ -1592,7 +1591,6 @@ PdoPreResume(
>          Request = CONTAINING_RECORD(Entry, XENVBD_REQUEST, Entry);
>          SrbExt = GetSrbExt(Request->Srb);
> 
> -        BlockRingAbort(BlockRing, Request);
>          PdoPutRequest(Pdo, Request);
> 
>          if (InterlockedDecrement(&SrbExt->Count) == 0) {
> --
> 1.9.4.msysgit.1
> 
> 
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

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


 


Rackspace

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