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

Re: [PATCH 2/2] Call BlkifRing(Acquire/Release)Lock before/after BlkifRingPoll


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Paul Durrant <xadimgnik@xxxxxxxxx>
  • Date: Mon, 21 Jun 2021 14:28:13 +0100
  • Delivery-date: Mon, 21 Jun 2021 13:28:18 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 21/06/2021 13:54, Owen Smith wrote:
Releasing the blkif ring lock drains the atomic SRB list into the queue. When
attempting to move things along, this also includes the atomic SRB list.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>

Acked-by: Paul Durrant <paul@xxxxxxx>

---
  src/xenvbd/ring.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 66e8cdd..1ea1250 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -2158,7 +2158,6 @@ BlkifRingDisable(
Trace("====> %u\n", BlkifRing->Index); - __BlkifRingAcquireLock(BlkifRing);
      ASSERT(BlkifRing->Enabled);
status = XENBUS_STORE(Read,
@@ -2188,8 +2187,10 @@ BlkifRingDisable(
                  break;
// Try to move things along
+            __BlkifRingAcquireLock(BlkifRing);
              __BlkifRingSend(BlkifRing);
              (VOID) BlkifRingPoll(BlkifRing);
+            __BlkifRingReleaseLock(BlkifRing);
// We are waiting for a watch event at DISPATCH_LEVEL so
              // it is our responsibility to poll the store ring.
@@ -2200,6 +2201,7 @@ BlkifRingDisable(
          }
      }
+ __BlkifRingAcquireLock(BlkifRing);
      BlkifRing->Enabled = FALSE;
while (!IsListEmpty(&BlkifRing->SubmittedList)) {





 


Rackspace

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