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

Re: [win-pv-devel] [PATCH] Rework request submission


  • To: Owen Smith <owen.smith@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Thu, 5 Sep 2019 14:47:32 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa5.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: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 05 Sep 2019 14:47:41 +0000
  • Ironport-sdr: sR57U+VE8HUmqZReOgSzmVppkA5vYyk1p3bDahTCWcjH9Vau7+6v9+NX85pyborKyJDJWKys1i 1JIfQrPa6R5zQVJGh8TzZwRiy2oeqqLNlJoTPnYs6u7SIb51b3Uy8mCygT97rfvaysQaxNUi8I UTBfB2zdMq527JX5pQKjVBoMSXRfsMJcPrMSuzEQryrJA42SMLkTv5pbcQBOs3XsObNncBzbew US4X7TYeT5QAuDvdZaJjkZRWvqBtKNH55GvifU9C9LnO+axyiAsQuXcCPh8c1l2W3W8ppT9yux lA0=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Thread-index: AQHVY+8yFlXsj2GvgkitOIQmZRj3zqcdKbZQ
  • Thread-topic: [win-pv-devel] [PATCH] Rework request submission

> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of 
> Owen Smith
> Sent: 05 September 2019 14:38
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith <owen.smith@xxxxxxxxxx>
> Subject: [win-pv-devel] [PATCH] Rework request submission
> 
> Make BlkifRingPostRequests return success for submitting 0 or more requests,
> or failure when the ring is full. This prevents the loop in BlkifRingSchedule
> from preparing the next SRB when the ring is already full.
> Also attempt to notify the backend of changes every iteration of the loop in
> BlkifRingSchedule, to trigger the backend as soon as possible.
> 
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

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

> ---
>  src/xenvbd/ring.c | 41 ++++++++++-------------------------------
>  1 file changed, 10 insertions(+), 31 deletions(-)
> 
> diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
> index 45a885d..2b3538e 100644
> --- a/src/xenvbd/ring.c
> +++ b/src/xenvbd/ring.c
> @@ -1089,28 +1089,21 @@ __BlkifRingPostRequests(
>      IN  PXENVBD_BLKIF_RING  BlkifRing
>      )
>  {
> -#define RING_SLOTS_AVAILABLE(_Front, _req_prod, _rsp_cons)   \
> -        (RING_SIZE(_Front) - ((_req_prod) - (_rsp_cons)))
> -
>      PXENVBD_SRB_STATE       State;
> -    RING_IDX                req_prod;
> -    RING_IDX                rsp_cons;
> -    NTSTATUS                status;
> 
>      State = &BlkifRing->State;
> 
> -    req_prod = BlkifRing->Front.req_prod_pvt;
> -    rsp_cons = BlkifRing->Front.rsp_cons;
> -
> -    status = STATUS_ALLOTTED_SPACE_EXCEEDED;
> -    if (RING_SLOTS_AVAILABLE(&BlkifRing->Front, req_prod, rsp_cons) <= 1)
> -        goto fail1;
> -
> -    while (State->Count != 0) {
> +    for (;;) {
>          blkif_request_t     *req;
>          PXENVBD_REQUEST     Request;
>          PLIST_ENTRY         ListEntry;
> 
> +        if (State->Count == 0)
> +            return STATUS_SUCCESS;
> +
> +        if (RING_FULL(&BlkifRing->Front))
> +            return STATUS_ALLOTTED_SPACE_EXCEEDED;
> +
>          --State->Count;
> 
>          ListEntry = RemoveHeadList(&State->List);
> @@ -1122,8 +1115,8 @@ __BlkifRingPostRequests(
>                                      XENVBD_REQUEST,
>                                      ListEntry);
> 
> -        req = RING_GET_REQUEST(&BlkifRing->Front, req_prod);
> -        req_prod++;
> +        req = RING_GET_REQUEST(&BlkifRing->Front, 
> BlkifRing->Front.req_prod_pvt);
> +        BlkifRing->Front.req_prod_pvt++;
>          BlkifRing->RequestsPosted++;
> 
>          __BlkifRingInsertRequest(BlkifRing,
> @@ -1131,19 +1124,7 @@ __BlkifRingPostRequests(
>                                   req);
> 
>          InsertTailList(&BlkifRing->SubmittedList, ListEntry);
> -
> -        if (RING_SLOTS_AVAILABLE(&BlkifRing->Front, req_prod, rsp_cons) <= 1)
> -            break;
>      }
> -
> -    BlkifRing->Front.req_prod_pvt = req_prod;
> -
> -    return STATUS_SUCCESS;
> -
> -fail1:
> -    return status;
> -
> -#undef  RING_SLOTS_AVAILABLE
>  }
> 
>  static FORCEINLINE PXENVBD_REQUEST
> @@ -1424,9 +1405,7 @@ BlkifRingSchedule(
>              continue;
>          }
> 
> -        if (BlkifRing->RequestsPosted - BlkifRing->RequestsPushed >=
> -            RING_SIZE(&BlkifRing->Front) / 4)
> -            __BlkifRingPushRequests(BlkifRing);
> +        __BlkifRingPushRequests(BlkifRing);
> 
>          if (IsListEmpty(&BlkifRing->SrbQueue))
>              break;
> --
> 2.16.2.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®.