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

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


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 21 Jun 2021 13:54:45 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Mon, 21 Jun 2021 13:01:42 +0000
  • Ironport-hdrordr: A9a23:Ig9U0aP+ZkuUYMBcTvmjsMiBIKoaSvp037Eqv3oedfUzSL3/qy nOpoVi6faaslYssR0b9exofZPwJE80lqQFhrX5X43SPzUO0VHAROoJgLcKgQeQfxEWntQtrJ uIGJIeNDSfNzdHZL7BkWuFL+o=
  • Ironport-sdr: Fes6/wXnNC+g0ecdV8loTFyyi0LD/ZK5a0lkyCJO+UK9+TNIGMrXozNdGnxaBCwjcwGp9ZtJyJ CxJ+rxQcglC1HydIsWD+NLLeD+cZ0J54OVPV92y4a2sVMeXCuTXzJyJ7Nj2H8+1NCkfKYXwGDV yfS+OJSWnCUya5qiHrAXX4s0WwQ3FleOLb6gqJntVGkCTNFmQCF6ryBdhyywdbIGvTj50yZnhq WcM73lp/pzIKBwGEYdNxW6/RJXFpto0vlkKOq/eYoiprCEFnw88panptM03YkKDxT+vDfrvdxn LGM=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

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>
---
 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)) {
-- 
2.31.1.windows.1




 


Rackspace

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