]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
Update rsp_event during BlkifRingPoll()
authorOwen Smith <owen.smith@citrix.com>
Thu, 5 Sep 2019 08:42:38 +0000 (09:42 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 5 Sep 2019 08:42:38 +0000 (09:42 +0100)
Currently, by updating it in __BlkifRingPushRequests(), the code is
attempting to defer events until all of the posted requests have responses
on the ring. This is likely to lead to a cycle of fill...empty...fill...
empty etc., which is bad for performance.

This patch instead updates rsp_event when BlkifRingPoll() completes, such
that the very next response placed on the ring by the backend should
cause an event to be sent.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
[Expanded commit message]
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvbd/ring.c

index 0dfba7f0e0194842118242b0f64b5ce1ec196507..74426f1eb4c43af013b575854654a4b182471588 100644 (file)
@@ -1294,6 +1294,7 @@ BlkifRingPoll(
         KeMemoryBarrier();
 
         BlkifRing->Front.rsp_cons = rsp_cons;
+        BlkifRing->Shared->rsp_event = rsp_cons + 1;
     }
 
 done:
@@ -1327,8 +1328,6 @@ __BlkifRingPushRequests(
 #pragma warning (push)
 #pragma warning (disable:4244)
 
-    BlkifRing->Shared->rsp_event = BlkifRing->Front.req_prod_pvt;
-
     // Make the requests visible to the backend
     RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&BlkifRing->Front, Notify);